jquery to achieve a picture page effect

Source: Internet
Author: User

 jquery to achieve a picture paging effect, you can use the following methods

    Code as follows: $ (function ($) {      $.fn.changelist = function (options) {        & nbsp var defaults = {                      tag: ' Li ',//tab name &nbs P                     subname: '. Utiltabsub ',//Sub class name   &N Bsp                   EventType: ' click ',//event type       &NB Sp               Num:4                   & nbsp   ShowType: "Show"//Show effect type                  ,   &nbs P               opts = $.extend ({}, defaults, options),         &NBSP ;         that = $ (this),                   Subul = thAt.find (Opts.subname),                   subitems = subul.find (' li '),                   size = subitems.length,                   LIW = Subitems.outerwidth (True),                   ULW = LIW * size,                   page = size + 1,         & nbsp         n = opts.num,                   Randnum = 0, &nbs P                 m = 0;               if (Size > N) {              that.fi nd (Opts.tag) [Opts.eventtype] (function () {                  Randnum = Mathran D (n, size);                   Subitems.hide ();                   $.each (randnum, function (i, EL) {      &NB Sp               Subitems.eq (EL) fadeIn (800);                                });          }      };  } (JQuery));      /**    * Create Random number    * @param bit:number    * @param max: Max number    * @return {Array}    */  function mathrand (bit, max) {      var num = 0,               arr = [],               RET = [] ;       for (var i=0 i<bit; i++) {          num = Math.floor (math.random () * max) ;           if ($.inarray (num, ret) = = 1) {   -          Ret.push (num);          } else {              i--      &NB Sp       continue;           {     }       return ret;  }    
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.