search
Homephp教程php手册The second release of the carousel plug-in with gradient function settings

Upgraded version is available
js code/**Image Carousel*/<br> /**Initial parameter settings*/<br> _fun={<br> Multid:'qi',//If multiple carousel plug-ins appear on a page, please copy the carousel code and set this parameter to a different value. This value is the id of ul<br> Multcla:'nei_img',//If multiple carousel plug-ins appear on a page, please copy the carousel code and set this parameter to a different value. This value is the class that wraps ul<br> sw:1,//Auto carousel switch 0 is on, 1 is off<br> ti:2000,//Automatic rotation time<br> sba:1,//Whether to display the selected label below<br> ba:'#ACAAAA',//Background color setting of the selected background<br> Ban:'#1D63AF',//Background color setting for unselected background<br> bacla:'qink',//Set the class of the check box below<br> jianb:1,//Whether to enable gradient<br> jianban:30,//Every time the picture gradients, the s parameter setting for the picture gradient must be less than 3% of the automatic playback time interval (recommended value 30)<br> }<br> /**Initial parameter settings*/<br> <br> var qik=1;<br> $(function(){//Carousel initialization <br> var lio=$('#'+_fun.multid+' li');<br> ​ lio.mouseover(function(){//Mouse the mouse into the image to stop automatic playback<br>         qik=0;<br> });<br> ​ lio.mouseout(function(){//Mouse the mouse out of the image to start automatic playback<br>         qik=1;<br> });<br> $.each(lio, function(k,v) {<br>            if(k==0){<br>                $(v).addClass('img_lib');<br>           }else{<br>                $(v).addClass('img_lin');<br>          }<br> }); <br> If(_fun.sba){<br> var obal=$('.'+_fun.multcla);<br> for(i=0;i<lio.length the elements added after are in reverse order first at end></lio.length> If(i==(lio.length-1)){<br> obal.after('<span class="'+_fun.bacla+'" style="background:'+_fun.ba+'" id="'+_fun.multid+(lio.length-i)+'" onmouseout="kai()" onclick="qin('+(lio.length-i)+')"></span> ');<br> }else{<br> obal.after('<span class="'+_fun.bacla+'" style="background:'+_fun.ban+'" id="'+_fun.multid+(lio.length-i)+'" onmouseout="kai()" onclick="qin('+(lio.length-i)+')"></span> ');<br> }<br> }<br> }<br> })<br> <br> function kai(){//Enable automatic playback function<br> ​ qik=1;<br> }<br> function den(){//Turn off the autoplay function<br> ​ qik=0;<br> }<br> <br> function qin(i){//Select function<br> ​ qik=0;//The automatic playback will stop after clicking the mouse<br> var liog_q=$('#'+_fun.multid+' li');<br> $.each(liog_q, function(kw,vw) {<br>            $('#'+_fun.multid+(kw+1)).css('background',_fun.ban);<br>            if(kw==(i-1)){<br>                 $(vw).removeClass('img_lin');<br>                 $(vw).addClass('img_lib');<br> If(_fun.jianb){<br>                   funqin(0,9,vw,_fun.jianban);//Gradient display function<br>             }<br>                                                    }else{<br>            $(vw).removeClass('img_lib');<br>             $(vw).addClass('img_lin');<br>         }<br>     });<br>     $('#'+_fun.multid+i).css('background',_fun.ba);<br> }<br> <br> function recoil(){//后退函数<br>     <br>     var liog_r=$('#'+_fun.multid+' li');<br>     var l_r=liog_r.length;<br>     var bl_r;<br>     $.each(liog_r, function(k,v) {<br>         if(v.className=='img_lib'){<br>           if(k!=0){    <br>               bl_r=k;<br>               $(v).removeClass('img_lib');<br>               $(v).addClass('img_lin');<br>             }else{<br>                 bl_r=l_r;<br>                 $(v).removeClass('img_lib');<br>                 $(v).addClass('img_lin');<br>             }<br>         }<br>     });<br>     $.each(liog_r, function(kw,vw) {<br>         if(kw==(bl_r-1)){<br>             $(vw).removeClass('img_lin');<br>             $(vw).addClass('img_lib');<br>             if(_fun.jianb){<br>                funqin(0,9,vw,_fun.jianban);//渐变显示函数<br>             }<br>             if(_fun.sba){<br>             $('#'+_fun.multid+(kw+1)).css('background',_fun.ba);//创建下面选择标签<br>             }<br>         }else{<br>             if(_fun.sba){<br>             $('#'+_fun.multid+(kw+1)).css('background',_fun.ban);<br>             }<br>         }<br>     });<br>     <br> }<br> <br> function geen(){//前进按钮函数<br>     <br>     var liog=$('#'+_fun.multid+' li');<br>     var l=liog.length;<br>     var bl;<br>     $.each(liog, function(k,v) {<br>         if(v.className=='img_lib'){<br>           if(k!=(l-1)){    <br>               bl=k;<br>               $(v).removeClass('img_lib');<br>               $(v).addClass('img_lin');<br>             }else{<br>                 bl=-1;                <br>                 $(v).removeClass('img_lib');<br>                 $(v).addClass('img_lin');<br>            }<br>          }<br> });<br> $.each(liog, function(kw,vw) {<br> If(kw==(bl+1)){<br>                 $(vw).removeClass('img_lin');<br>                 $(vw).addClass('img_lib');<br> If(_fun.jianb){<br>                   funqin(0,9,vw,_fun.jianban);//Gradient display function<br>             }<br>                   if(_fun.sba){<br>                     $('#'+_fun.multid+(kw+1)).css('background',_fun.ba);//Create the following selection tag<br>             }<br>           }else{<br>                   if(_fun.sba){<br>                  $('#'+_fun.multid+(kw+1)).css('background',_fun.ban);<br>             }<br>          }<br> });<br> ​ <br> }<br> <br> function funqin(i,k,ob,s){//Numerical growth function, used for picture gradient s parameter setting must be less than 10% of the automatic playback time interval<br> If(i<k></k>           i++;<br>          $(ob).css('opacity','0.'+i+'9');<br> }<br> setTimeout(function(){//Must be written as an anonymous function so that it can accept parameters<br>          funqin(i,k,ob,s);<br> },s);<br> }<br> <br> <br> function gee(){//Forward function-(regular time function, cannot be used as a forward button function)<br> If(qik){//Because the time jump function calls the forward function, set the switch in this function<br> var liog=$('#'+_fun.multid+' li');<br> var l=liog.length;<br> var bl;<br> $.each(liog, function(k,v) {<br> If(v.className=='img_lib'){<br> If(k!=(l-1)){ <br>                  bl=k;<br>                    $(v).removeClass('img_lib');<br>                    $(v).addClass('img_lin');<br>                  }else{<br>                    bl=-1;<br>                           $(v).removeClass('img_lib');<br>                               $(v).addClass('img_lin');<br>             }<br>          }<br> });<br> $.each(liog, function(kw,vw) {<br> If(kw==(bl+1)){<br>                 $(vw).removeClass('img_lin');<br>                 $(vw).addClass('img_lib');<br> If(_fun.jianb){<br>                   funqin(0,9,vw,_fun.jianban);//Gradient display function<br>             }<br>                   if(_fun.sba){<br>                                                                                                                                                                                                      $('#'+_fun.multid+(kw+1)).css('background',_fun.ba);//Create the following selection tag<br>              }<br>           }else{<br>                   if(_fun.sba){<br>                  $('#'+_fun.multid+(kw+1)).css('background',_fun.ban);<br>              }<br>         }<br> });<br> }<br> }<br> <br> /**Scheduled execution starts*/<br> if(_fun.sw){<br> setInterval (function(){//Anonymous function packaging so that it can accept parameters<br>         gee();<br> }, _fun.ti);<br> }<br> /**Timing execution ends*/<br> /**Image Carousel*/Open all renderings:
The second release of the carousel plug-in with gradient function settings
Close the check box effect picture below:
The second release of the carousel plug-in with gradient function settings
Modify the background color of the check box:
The second release of the carousel plug-in with gradient function settings
The second release of the carousel plug-in with gradient function settings
(Styles can be modified in the css file)

The second release of the carousel plug-in with gradient function settings qin.zip ( 896.86 KB Download: 6 times )

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool