編輯器實(shí)時(shí)產(chǎn)生作用,當(dāng)書寫for的時(shí)候容易出現(xiàn)死循環(huán)讓頁面卡死!
2016-03-09
var oDiv = document.getElementById('div');
var aPic = oDiv.getElementsByTagName('div');
for(var i=0;i<aPic.length;i++){
apic[i].onmouseover=function(){
this.getElementsByTagName('a').style.top=0;
}
apic[i].onmouseover=function(){
this.getElementsByTagName('a').style.top='160px';
}
}
var aPic = oDiv.getElementsByTagName('div');
for(var i=0;i<aPic.length;i++){
apic[i].onmouseover=function(){
this.getElementsByTagName('a').style.top=0;
}
apic[i].onmouseover=function(){
this.getElementsByTagName('a').style.top='160px';
}
}
2015-12-21
老師 不能修改下么 比如提交代碼時(shí)候 右面再出來 情況 顯示的東西不行么 這個(gè)for循環(huán) 讓我的網(wǎng)頁 快死了100次了 我擦
2015-09-07
說點(diǎn)總體的感受吧,這門課程對我最大的啟發(fā)是使用:hover偽類來實(shí)現(xiàn)一些操作,可以設(shè)定該偽類從而對元素以及子孫元素實(shí)現(xiàn)樣式改變。今天就寫了幾個(gè)效果:hover時(shí)opacity改變(以前opacity沒怎么用過,今天一用解決了三的地方的問題),hover時(shí)圖片大小改變,hover時(shí)元素的顯示與消失。至于后面的js,稍微接觸過的人其實(shí)不用聽這節(jié)課。很感謝授課老師。順便想明白了那個(gè)聚劃算的設(shè)計(jì),hover時(shí)改變width。
2015-08-25
用jq:
$(document).ready(function(){
$('#picList div').mouseover(function(){
$(this).find('a').attr('top',0);
});
mouseout類似
})
$(document).ready(function(){
$('#picList div').mouseover(function(){
$(this).find('a').attr('top',0);
});
mouseout類似
})
2015-08-24