課程
/前端開(kāi)發(fā)
/JavaScript
/網(wǎng)頁(yè)定位導(dǎo)航特效
$("#menu").find("[href=#" + iteamId+ "]").addClass("current");
2016-09-09
源自:網(wǎng)頁(yè)定位導(dǎo)航特效 4-3
正在回答
用了jquery1.10.2 ?沒(méi)問(wèn)題了 ?應(yīng)該是 版本的問(wèn)題了 蛋疼
<script type="text/javascript">
$(document).ready(function(){
$(window).scroll(function(){
var iteamId;
$(".iteam").each(function(){
if ($(document).scrollTop() > $(this).offset().top) {
iteamId = $(this).attr("id");
}
});
$("#menu").find(".current").removeClass("current");
})
</script>
舉報(bào)
本課程講解網(wǎng)頁(yè)定位導(dǎo)航特效,仿天貓版地狗購(gòu)物網(wǎng),你值得擁有
1 回答正則表達(dá)式
3 回答正則表達(dá)式
2 回答正則表達(dá)式
2 回答[href="+currentId+"]格式問(wèn)題
1 回答currentId識(shí)別不出來(lái)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-09-09
用了jquery1.10.2 ?沒(méi)問(wèn)題了 ?應(yīng)該是 版本的問(wèn)題了 蛋疼
2016-09-09
<script type="text/javascript">
$(document).ready(function(){
$(window).scroll(function(){
var iteamId;
$(".iteam").each(function(){
if ($(document).scrollTop() > $(this).offset().top) {
iteamId = $(this).attr("id");
}
});
$("#menu").find(".current").removeClass("current");
$("#menu").find("[href=#" + iteamId+ "]").addClass("current");
});
})
</script>