JavaScript Basics 03
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, default to 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, and the following Prevtext and Nexttext are related, they are the way it is in the page representation 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 nexttext: ">", });
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)--><div id= "banner" > <ul class= "Rslides" id= "Rslides" > <li></li> <li></li> <li></li> <li></li> <li></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