<!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=gb2312" /> <title>无标题文档</title> <script type="text/javascript" src="js/jquery-1.4.2.js"></script> <style type="text/css"> body{ font-size:14px;} img{ border:1px solid #ccc; padding:3px;} </style> <script type="text/javascript"> $(function(){ $("img").toggle(function(){ $("img").attr("src","images/01.png"); $("img").attr("title",this.src); },function(){ $("img").attr("src","images/02.png"); $("img").attr("title",this.src); },function(){ $("img").attr("src","images/03.png"); $("img").attr("title",this.src); }) }) </script> </head> <body> <img /> </body> </html>?
详细解决方案
toggle兑现图片切换
热度:243 发布时间:2012-11-23 00:03:29.0
相关解决方案
- jquerymobile-17 搜寻框、滑动按钮(Slider)、开关(Flip toggle switch)
- toggle()步骤进行显示隐藏交互事件
- Jquery 1.10 toggle() Deprecated 顶替方法
- toggle()函数的使用
- 动画片方法(animate)-toggle() slideToggle() fadeTo()
- toggle 折叠菜单页面跳转有关问题
- Bootstrap data-toggle 的使用
- 常用控件(ProgressBar,Toggle,Switch,SeekBar,RatingBar)解析
- js动态生成html中的data-toggle=tooltip无效
- bootstrap——data-toggle、data-target、collapse
- 【Cocos Creator实战教程(9)】——UI组件(3)Toggle 组件
- js toggle 循环触发事件使div折叠或展开
- unity ugui Toggle Group详解