jQuery变颜色以及下拉列表冲突问题
鼠标移入移出事件不冲突
变颜色和内容举例
function changeColor() {
$('.directorySection li').hover(
function () {
$(this).css('color', '#00cf8c')
$(this).children().eq(1).html('观看')
},
function () {
$(this).css('color', '#000000a6')
$(this).children().eq(1).html('<img src="./images/player2.png" alt="" />')
}
)
}
下拉列表举例
function loginList(parent, child) {
$(parent).hover(
function () {
$(child).stop().slideDown(100)
},
function () {
$(child).stop().slideUp(100)
}
)
}
loginList('.getUserInfo', '.userInfoList')
loginList('.selectList', '.select')