JavaScript Basics 03

Source: Internet
Author: User
Tags arithmetic operators

1. Arithmetic operators

Post increment/decrement operator + +,--

Comparison operator (<, >=, <=, = =,!=,===,!==)

Logical Operators (&&, | |,!)

Comparison of strings

The string is sized by the code point of the character in Unicode and compares the size from the beginning of the first character, if equality compares the next character until the size is compared or the characters are Compared.

Alert ("101"<"3"); returns True

2. Program Flow control

first, Conditional Statement IF

The conditional curly braces code is only executed when the condition is True.

second, Switch statement

Grammar:

Switch (expression) {case        value:            //statement break            ;        Case Value:            //statement Break            ;        Default:            //statement    }

The expression satisfies a value to execute the code corresponding to that value, and if none of the criteria is met, the code in the default will be Executed.

Extended:

Introduce a plugin today: responsiveslides

It is a plug-in to do the carousel, based on jquery, it feels good to use, can do the response of the Carousel diagram, from the name can be Known.

It is a modular plug-in, based on object-oriented, but jquery, object-oriented way to deal with, so directly read the source

may be difficult to understand.

But it has a good description of how to Use:

$ (function () {    $ (". rslides"). responsiveslides ({          pager:true,                     //default = false, need to show (true) to display index points, The default is the number 12345, go to the JS library to modify it, remove n, Modify the style can appear their own needs, such as Dot          nav:true,             //show the previous and next navigation, with the following prevtext and Nexttext are associated with, They are the way it is represented in the page          pause:false,           //mouse move out whether stop          pausecontrols:true,    //boolean:pause when hovering controls , True or False          prevtext: "<",   //modify the left and right          button symbols "> ",           });  });

As for the need to greatly modify the desired effect, this can be used with the browser debugging tools

To find their selectors, rewrite them directly in the css, overwriting the previous style,

This makes it possible to make a suitable carousel Diagram.

The above is only part of the parameters, there are many, not yet to modify the observation Effect.

HTML code:

<!--use a div to wrap it, and those JS added tags will be loaded directly behind the UL tag (and This add is not written to add, just modify the above parameters will be automatically added) -<DivID= "banner">    <ulclass= "rslides"ID= "rslides">      <Li><imgsrc= "111.jpg"alt=""></Li>      <Li><imgsrc= "222.jpg"alt=""></Li>      <Li><imgsrc= "333.jpg"alt=""></Li>      <Li><imgsrc= "444.jpg"alt=""></Li>      <Li><imgsrc= "555.jpg"alt=""></Li>    </ul></Div>

In the download Responsiveslides package there is a CSS file, which is the default CSS settings, there is a need to use debugging tools, while debugging while modifying

There are many similar plug-ins on the internet, but I don't know how to use them quickly and flexibly, they are very stiff, they can't be used Together.

Up and reseal it into a plugin.

JavaScript Basics 03

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.