


jQuery implements a complete example of content timing switching effect_jquery
The example in this article describes jQuery’s implementation of scheduled content switching effects. Share it with everyone for your reference, the details are as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>左右切换内容 </title> <script type="text/javascript"> </script> <style type="text/css"> /* Reset style */ * { margin:0; padding:0; word-break:break-all; } body { background:#FFF; color:#333; font:12px/1.6em Helvetica, Arial, sans-serif; } h1, h2, h3, h4, h5, h6 { font-size:1em; } a { color:#039; text-decoration:none; } a:hover { text-decoration:underline; } ul, li { list-style:none; } fieldset, img { border:none; } em, strong, cite, th { font-style:normal; font-weight:normal; } #change{ position:relative; top :20px;left:60px } /* Hot_ranks style */ #hot_ranks { position:relative; width:190px; overflow:hidden; margin:50px; border:1px solid #E0E0E0; background:#F6F8F8; } #hot_ranks h3 { padding:8px 8px 6px 8px; font-size:14px;} #hot_ranks .hot_ranks_list { padding-bottom:6px; } #hot_ranks .normal { display:none; } #hot_ranks .current { display:block; } #hot_ranks ul li { width:95%; height:21px; overflow:hidden; margin:0 auto; line-height:20px; } #hot_ranks ul li em { padding:0 1px 0 3px; } #ranks_change_bar { position:absolute; top:8px; right:2px; } #ranks_change_bar a { display:block; float:left; width:27px; height:13px; overflow:hidden; margin:0 2px; background:url(arrow.gif) no-repeat; text-indent:-9999px; cursor:pointer;} #ranks_change_bar #previous { background-position:0 0; } #ranks_change_bar #next { background-position:-27px 0; } </style> <script src="jquery-1.7.2.min.js" type="text/javascript"></script> <script language="javascript"> $(function(){ abc(); }); function abc(){ var $obj = $('#hot_ranks ul'); var len = $obj.length; var i = 0; $("#next").click(function(){ i++; if(i==len){ i = 0; } $obj.stop(true,true).hide().eq(i).fadeIn(600); return false; }); $("#previous").click(function(){ i--; if(i==-1){ i = len-1; } $obj.stop(true,true).hide().eq(i).fadeIn(600); return false; }); //每2秒,自动切换。触发".next"的click事件 var MyTime = setInterval(function(){ $("#next").trigger("click"); } , 4000); } </script> </head> <body> <div id="hot_ranks"> <h3 id="站点价值排行">站点价值排行</h3> <ul class="current" style="display: block;"> <li><em>1</em> <a href="#">首支北京奥运比赛用枪入境</a></li> <li><em>2</em> <a href="#">"最稳金牌"落选奥运阵容</a></li> <li><em>3</em> <a href="#">微软否认盖茨为看奥运租房</a></li> <li><em>4</em> <a href="#">金晶坐飞机被蛮横夫妇欺侮</a></li> <li><em>5</em> <a href="#">俄美女展示奥运服 奥运兵马俑亮相京城装</a></li> <li><em>6</em> <a href="#">五部奥运题材电影出炉 志愿者微笑迎奥运</a></li> <li><em>7</em> <a href="#">奥运志愿者不乏绝世佳丽 清纯奥运引导员</a></li> <li><em>8</em> <a href="#">奥运饭店正式运行 国际奥委会各部门入驻</a></li> </ul> <ul class="normal" style="display: none; "> <li><em>9</em> <a href="#">奥运会中国最稳的十个冠军</a></li> <li><em>10</em> <a href="#">女大学生怎么成了悲惨"卡奴"</a></li> <li><em>11</em> <a href="#">80岁老母竟被儿女逼得有家难回</a></li> <li><em>12</em> <a href="#">日本街头清新美女如此混搭(图)</a></li> <li><em>13</em> <a href="#">视频:人眼永远看不到的真相!</a></li> <li><em>14</em> <a href="#">87版红楼梦那些难忘笑靥(组图)</a></li> <li><em>15</em> <a href="#">美女股神:散户就是被宠坏的人</a></li> <li><em>16</em> <a href="#">我的80后老婆从绵羊变成大灰狼</a></li> </ul> <ul class="normal" style="display: none; "> <li><em>17</em> <a href="#">马自达6轿跑全系让利2万元 新威驰全系优惠8000</a></li> <li><em>18</em> <a href="#">"[降价]致胜全系让2.8万元 海马3现车优惠1万元</a></li> <li><em>19</em> <a href="#">桑塔纳志俊优惠3000元 林荫大道优惠3万提销量</a></li> <li><em>20</em> <a href="#">金晶坐飞机被蛮横夫妇欺侮</a></li> <li><em>21</em> <a href="#">俄美女展示奥运服 奥运兵马俑亮相京城装</a></li> <li><em>22</em> <a href="#"> [闲聊]路拍亚洲最长悍马 强人用遥控车画大黄蜂</a></li> <li><em>23</em> <a href="#">奥运志愿者不乏绝世佳丽 清纯奥运引导员</a></li> <li><em>24</em> <a href="#">大开眼界的路虎悬挂车展 "最有趣"车名排行榜</a></li> </ul> <p id="ranks_change_bar"><a href="#" id="previous">上一页</a><a href="#" id="next">下一页</a></p> </div> </body> </html>
Readers who are interested in more jQuery-related content can check out the special topics on this site: "JQuery table (table) operation skills summary", "jQuery drag effects and skills summary ", "jQuery extension skills summary", "jQuery common classic special effects summary", "jQuery animation and special effects usage summary", "jquery selection Summary of tool usage" and "JQuery common plug-ins and usage summary"
I hope this article will be helpful to everyone in jQuery programming.

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

JavaScript's applications in the real world include server-side programming, mobile application development and Internet of Things control: 1. Server-side programming is realized through Node.js, suitable for high concurrent request processing. 2. Mobile application development is carried out through ReactNative and supports cross-platform deployment. 3. Used for IoT device control through Johnny-Five library, suitable for hardware interaction.

I built a functional multi-tenant SaaS application (an EdTech app) with your everyday tech tool and you can do the same. First, what’s a multi-tenant SaaS application? Multi-tenant SaaS applications let you serve multiple customers from a sing


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Notepad++7.3.1
Easy-to-use and free code editor