如图:
代码:
html
- @foreach (Brand item in ViewBag.Brand) {
- @item.name }
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" });});