点击哪个按钮对应图片显示,按钮对应颜色显示
2017-09-23 11:38
573 查看
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <link href="index.css" rel="stylesheet" type="text/css"> </head> <body> <!--neirong--> <style> .neirong_box{ width:100%; background-color:#f0f0f0; border-top:1px solid #e6e6e6; padding-top:25px; margin-top:30px;} .neirong{ width:1100px; margin:0 auto; } .pic{ width:546px; float:left; position:relative;background-color: rgb(255, 255, 255); box-shadow: 0px 0px 2.79px 0.21px rgba(191, 191, 191, 0.004);} .pic img{ width:546px; height:417px;} .dot{ position:absolute; bottom:1%; right:5%; } .dot span{ float:left; margin-right:10px;border-radius: 50%;background-color: rgb(240, 240, 240);;width: 15px;height: 15px;} .dot .current_dot{background-color:#34759e; } </style> <div class="neirong_box"> <div class="neirong"> <div class="pic"> <img src="img/b0.png" alt="" /> <img src="img/b2.png" alt="" /> <img src="img/b3.png" alt="" /> <div class="dot"> <span></span> <span></span> <span></span> </div> </div> </div> </div> <script src="jquery.js"></script> <script > //neirong //$(function(){ // $(".dot span:eq(0)").addClass(" current_dot") // $(".pic img").hide().first().show() // var n=0 // $(".dot span").mouseenter(function(){ // // // n=$(this).index() // $(".pic img").hide().eq(n).show() // }) // //$(".dot span").mouseenter(function(){ // $(this).addClass(" current_dot") // .siblings().removeClass(" current_dot") // }) // }) // 简洁压缩版 $(function(){ $(".dot span:eq(0)").addClass(" current_dot") $(".pic img").hide().first().show() $(".dot span").mouseenter(function(){ $(".pic img").hide().eq($(this).index()).show() $(this).addClass(" current_dot") .siblings().removeClass(" current_dot") }) }) </script> </body> </html>
相关文章推荐
- 点击按钮显示对应的图片
- 传参小例子--点击哪个按钮显示相对应的盒子
- 求助:想实现点击按钮“下一张”就会显示下一张图片的函数
- 在vc控件中显示图片,点击按钮变换图片
- iOS 点击cell改变背景颜色或者图片&&cell中其他部分取消高亮显示
- 点击某个按钮切换图片、文字描述(按钮颜色跟着改变)(简化代码)
- 英语音标的录入。点击按钮,点击图片,点击图标等,在RTF文本框中显示字体中的字符。
- 点击按钮或者某一张图片时怎样在文本域中显示图片
- 代码实现 按钮点击出现不同的图片或者颜色
- phpcms上传图片时,点击【上传到服务器上】按钮,显示:缺少图像源地址的解决方法
- 一屏只显示横向排列的四张图片,如何控制点击“向下”按钮过快,导致出现图片不能在一屏中垂直居中显示?
- 按钮点击,图片改变,显示点击效果
- js 实现点击浏览图片按钮时同时显示图片
- 网站点击导航栏标题,对应的元素平滑上移以及点击图片或按钮回到页面顶部的特效
- 点击一个切换按钮 按钮的文字切换 对应的内容也跟着显示隐藏
- android颜色(图片)和对应的值-----颜色和值直观显示
- DOM基础1之点击小图片显示对应的大图
- 点击查看图片---弹窗直接显示图片并带关闭按钮
- android 显示16色的图片:输入用颜色矩阵,显示对应的16色位图
- MFC实现当鼠标移动到button按钮上时是显示一张图片,移开显示另外一张,点击是显示另外一张