JQ Carousel Diagram
functionbanner_show () {varLEFT_BTN = $ ("#banner_tag_left"); Get left click buttonvarRIGHT_BTN = $ ("#banner_tag_right"); Get Right click ButtonvarOwidth = $ ("#banner ul Li"). width (); Get a single picture widthvarOindex = $ ("#banner ul Li"); Get the number of pictures that need to be carouselvarBanner_w = $ ("#banner"). width (); Get Total widthvarindex = 0;//define the number of bits of the current Carousel $ (LEFT_BTN). Bind ("Click",function() {index++; if(Index> (oindex.length-1) {//When the last picture is placed, the number of digits resets the index= 0; } $("#banner"). Animate ({//jq animation method left:-owidth*index+ "px",//position is positioned, the left value is a negative width multiplied by the number of digits (Width * index)},300) }); $ (RIGHT_BTN). Bind ("Click",function() {index--; if(index<0) {Index=oindex.length-1; When in the first diagram, the number of bits becomes the last one} $ ("#banner"). Animate ({left:-owidth*index+ "px",//position positioning. The left value is a negative width multiplied by the number of digits (Width * index)
}); }
Jquery implementation of Carousel diagram