第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

圖片點(diǎn)擊切換效果怎么不行啊,求幫忙看看

圖片點(diǎn)擊切換效果怎么不行啊,求幫忙看看

慕粉4084340 2016-10-23 20:05:43
本來在 showPic函數(shù)里不修改title屬性可以正常運(yùn)行,但是一加上description的文字可以運(yùn)行,但是一加上后面那一段就不行了,求幫忙<!doctype html><html><head>??? <meta charset="UTF-8">??? <title>Document</title></head><body>??? <ul id="imagegellery">??????? <li>??????????? <a href="1.jpg" title="第1張圖片">第1張圖片</a>??????? </li>???????? <li>??????????? <a href="2.jpg" title="第2張圖片">第2張圖片</a>??????? </li>???????? <li>??????????? <a href="3.jpg" title="第3張圖片">第3張圖片</a>??????? </li>??? </ul><script>??? function addLoadEvent(func){??????? var oldonload=window.onload;??????? if(typeof window.onload!='function'){??????????? window.onload=func;??????? }else{??????????? window.onload=function(){??????????????? oldonload();??????????????? func();??????????? }??????? }??? }??? function insertAfter(newElement,targetElement){??????? var parent=targetElement.parentNode;??????? if(parent.lastChild==targetElement){??????????? parent.appendChild("newElement");??????? }else{??????????? parent.insertBefore(newElement,targetElement.nextSibling);??????? }??? }??? function preparePlaceholder(){??????? var placeholder=document.createElement("img");??????? placeholder.setAttribute("id","placeholder");??????? placeholder.setAttribute("src","4.jpg");??????? placeholder.setAttribute("alt","默認(rèn)圖片");??????? var description=document.createElement("p");???????? var description=document.createElement("id","description");???????? var desctext=document.createTextNode("默認(rèn)圖片");???????? description.appendChild(desctext);???????? var gallery=document.getElementById("imagegellery");???????? insertAfter(placeholder,gallery);???????? insertAfter(description,gallery);??? }??? function preareGallery(){??? var gallery=document.getElementById("imagegellery");??? var links=gallery.getElementsByTagName("a")??? for (var i = 0; i < links.length; i++) {??????? links[i].onclick=function(){??????????? return showPic(this);??????? }??????? links[i].onkeypress=links[i].onclick;??? };}function showPic(whichpic){??? var source=whichpic.getAttribute("href");??? var placeholder=document.getElementById("placeholder")???? placeholder.setAttribute("src",source)???? if(whichpic.getAttribute("title")){???? var text=whichpic.getAttribute("title");}???? else{var text="";}???? var description=document.getElementById("description")???? if(description.firstChild.nodeType==3){???? description.firstChild.nodeValue=text;?}??? ???? return false;}addLoadEvent(preparePlaceholder)addLoadEvent(preareGallery)</script>?? ?</body></html>
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1344 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號