JQuery------实现鼠标点击和滑动不同效果
2017-02-10 16:23
429 查看
如图:
代码:
html
js
代码:
html
<ul class="price-brand-right"> @foreach (Brand item in ViewBag.Brand) { <li class="li-brand" style="cursor:pointer;">@item.name<input type="hidden" value="@item.brandid"></li> } </ul>
js
//品牌鼠标移动 $(".li-brand").hover(function () { var b = $(this).css("fontWeight"); if (b.indexOf("bold") != -1) { return false; } $(this).css({ "color": "red", "text-decoration": "underline" }); }, function () { var b = $(this).css("fontWeight"); if (b.indexOf("bold") != -1) { return false; } $(this).css({ "color": "#666", "text-decoration": "none" }); }); //品牌点击 $(".li-brand").click(function () { $(this).css({ "color": "green", "fontWeight": "bold", "text-decoration": "none" }); $(this).prevAll("li").css({ "color": "#666", "fontWeight": "normal" }); $(this).nextAll("li").css({ "color": "#666", "fontWeight": "normal" }); });
相关文章推荐
- jquery实现鼠标点击后展开列表内容的导航栏效果
- 基于jQuery实现鼠标点击导航菜单水波动画效果附源码下载
- 原生js实现鼠标点击效果(不是真实鼠标点击,用js模拟鼠标点击,类似jquery trigger效果)
- jquery实现导航栏随鼠标点击跟随滑动动画
- js实现鼠标点击左上角滑动菜单效果代码
- jQuery实现菜单感应鼠标滑动动画效果的方法
- jQuery实现鼠标滑过链接控制图片的滑动展开与隐藏效果
- jquery实现隔行变色,点击换色,鼠标悬浮当前行变色效果,div+css 细表格样式
- jquery实现在鼠标点击处的炫酷效果
- jquery实现鼠标拖拽滑动效果来选择数字的方法
- js实现鼠标点击左上角滑动菜单效果代码
- 基于jQuery实现鼠标点击导航菜单水波动画效果附源码下载
- jquery实现鼠标点击后展开列表内容的导航栏效果
- jquery点击页面任何区域实现鼠标焦点十字效果
- jQuery实现鼠标点击处心形漂浮的炫酷效果示例
- 使用jQuery实现鼠标点击左右按钮滑动切换
- jQuery实现鼠标滑过链接控制图片的滑动展开与隐藏效果
- jQuery实现鼠标点击div外的地方div隐藏消失的效果
- jQuery实现菜单感应鼠标滑动动画效果的方法
- jQuery实现的 “滑动门”(跟随鼠标滑动滑动的tab选项卡)效果