Jquery.easie.js development of object-oriented banner focus map components based on JQ

Source: Internet
Author: User

<!--Banner Begin -<Divclass= "banner Min_width"ID= "One"style=""><spanclass= "Foucl Fouc"></span> <ul>   <Listyle= "Background:url (./images/banner.jpg) no-repeat center top; height:454px;"><ahref=""></a></Li>   <Listyle= "Background:url (./images/banner1.jpg) no-repeat center top; height:454px;"><ahref=""></a></Li>   <Listyle= "Background:url (./images/banner2.jpg) no-repeat center top; height:454px;"><ahref=""></a></Li> </ul> <spanclass= "FOUCR Fouc"></span>    <Divclass= "Foucdocs"></Div></Div><!--Banner End -<Script>    $(function() {Scroll ({dome:$ ('#one'), next:$ ('. Foucl'), pre:$ ('. FOUCR')        }); })</Script>
;(function($, window, document, undefined) {functionScroll () { This. num = 0;  This. obj = This;  This. Dome =NULL;  This. Dome_ul =NULL;  This. dome_li_lent =NULL;  This. Full_wit =NULL;  This. Timer =NULL;  This. Next =NULL;  This. Pre =NULL;  This. Settings ={times:2000, Way_annimate:' Ease-out ',        }; } scroll.prototype.init=function(opt) {varthis = This; varPos_left =NULL;  This. Options = $.extend ({}, This. Settings, opt) This. Dome = This. Options.dome;  This. Dome_ul = This. Dome.find (' ul ');  This. Dome_ul.append ( This. Dome_ul.find (' Li:first '). Clone ()) This. dome_li_lent = This. Dome_ul.find (' Li '). length;  for(varb = 0; b < This. dome_li_lent; b++) {             This. Dome.find ('. Foucdocs '). Append (' <span></span> ')); }         This. Dome.find ('. Foucdocs span '). EQ (0). addclass (' focus_on ');  This. Next = This. Dome.find ( This. Options.next);  This. Pre = This. Dome.find ( This. Options.pre);  This. getwidth ();  This. Timer =setinterval (Gos, This.options.times); $ (window). Resize (function() {this.getwidth (); })         This. Dome.hover (function() {This.next.show ();            This.pre.show ();        Clearinterval (This.timer); }, function() {This.next.hide ();            This.pre.hide (); This.timer=setinterval (Gos, This.options.times); })        functionGos () {This.num++; if(This.num > (this.dome_li_lent-1) ) {This.num= 0; } This.dome.find ('. Foucdocs span '). EQ (this.num). addclass (' focus_on '). Siblings (' span '). Removeclass (' focus_on ')) Pos_left= (This.full_wit *this.num); This.dome_ul.stop (). Animate ({left:-pos_left + ' px '}, This.options.way_annimate); }         This. Dome.find ('. Foucdocs span '). MouseOver (function() {This.num=$( This). index (); Pos_left= (This.full_wit *this.num); This.dome_ul.stop (). Animate ({left:-pos_left + ' px '}, This.options.way_annimate); $( This). addclass (' focus_on '). Siblings (' span '). Removeclass (' focus_on ')); })         This. Next.Click (function() {Gos (); })         This. Pre.click (function() {This.num--; if(This.num < 0) {This.num= This.dome_li_lent-1; Console.log (This.num)} This.dome.find ('. Foucdocs span '). EQ (this.num). addclass (' focus_on '). Siblings (' span '). Removeclass (' focus_on ')); a pos_left= (This.full_wit *this.num); This.dome_ul.stop (). Animate ({left:-pos_left + ' px '}, This.options.way_annimate); })} Scroll.prototype.getwidth=function () {         This. Full_wit =$ (window). width ();  This. Dome_ul.css ({width: This. Full_wit * This. dome_li_lent + ' px ',        })  This. Dome_ul.find (' Li '). css ({width: This. Full_wit + ' px ',        }) } window. Scroll=function(opt) {varLitscoll =NewScroll ();    Litscoll.init (opt); }}) (JQuery, window, document);
Git repository Address: https://github.com/XINYUHAI77/jquery_full

Based on JQ, Jquery.easie.js developing object-oriented banner focus map components

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.