jquery简单实现图片切换效果的方法
网络编程 2021-07-04 21:48www.168986.cn编程入门
这篇文章主要介绍了jquery简单实现图片切换效果的方法,涉及jQuery链式操作及图片操作的相关技巧,需要的朋友可以参考下
本文实例讲述了jquery简单实现图片切换效果的方法。分享给大家供大家参考。具体实现方法如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://.w3./1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> #slider{ position:relative; overflow:hidden; margin:20px auto; height:240px; width:740px; padding:5px; border:2px solid #cdcdcd; } #show{ position:relative; height:240px; width:740px; } #show .img{ width:740px; height:240px; margin-bottom:5px; } #num{ position:absolute; right:5px; :220px; } #num span{ float:left; display:block; text-align:center; width:20px; height:20px; line-height:20px; margin:2px; font-family:Arial, Helvetica, sans-serif; font-size:14px; font-weight:blod; background:#f2f2f2; border:1px solid #D78918; color:#D78918; } #num .current{ color: #fff; width:21px; height:21px; line-height:21px; font-size: 16px; border:0px; margin:0px 1px; background-color: #FF7300; } </style> <script src="js/jquery-1.3.1.js" type="text/javascript"></script> <script type="text/javascript"> <!-- $(function(){ var count=1; setInterval(function(){ count=count==5?0:count; var =-count*(240+5); count++; $("#show").animate({:},600); $("#num").find("span").eq(count-1).addClass("current").siblings().removeClass("current"); },2000); }) --> </script> </head> <body> <div id="slider"> <div id="show"> <div class="img" style="background:red;"></div> <div class="img" style="background:blue"></div> <div class="img" style="background:gold"></div> <div class="img" style="background:yellow"></div> <div class="img" style="background:green"></div> </div> <div id="num"> <span class="current">1</span> <span>2</span> <span>3</span> <span>4</span> <span>5</span> </div> </div> </body> </html>
希望本文所述对大家的jQuery程序设计有所帮助。
上一篇:js实现两点之间画线的方法
下一篇:浅谈javascript的分号的使用
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程