一个小问题。。。_html/css_WEB-ITnose
这段代码的问题在哪呢?总是提示说onmouseover标签的div属性不被支持。。。
但是我在前面的script中定义了divControl了啊。。。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">.menubar{position:absolute;top:10px;width:100px;height:20px;cursor:default;border-width:1px;border-style:outset;color:#00CCCC;background:#99CC33}.menu{position:absolute;top:32px;width:140px;display:none;border-width:2px;border-style:outset;border-color:#FFFFFF;background:#99CC33;padding:15px}.menu A{text-decoration:none;color:#00FF66}.menu A:hover{color:#FF6666}</style><script language="javascript">function divControl(show){window.event.concelBubble=true;var objID=event.srcElement.id;var index=objID.indexof("_");var mainID=objID.substring(0,index);var numID=objID.substring(index+1); if(mainID=="Tdiv"){ if(show==1){eval("showdiv("+"Div+"+numID+")");} else{eval("hidediv("+"Div+"+numID+")");} } }var nbottom=0,speed=2;function displayMenu(obj){obj.style.clip="rect(0 100% "+nbottom+"% 0)";nbottom+=speed;if(nbottom<=100){timerID=setTimeout("displayMenu("+obj.id+")");}else clearTimeout(timerID);}function showdiv(obj){obj.style.display="block";obj.style.clip="rect(0 0 0 0)";nbottom=5;displayMenu(obj);}function hidediv(obj){nbottom=0;obj.style.display="none";}function keepstyle(obj){obj.style.display="block";}</script><title>无标题文档</title></head><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="0" style="font-size:15px"><tr><td width="20%"><div align="center" id="Tdiv_1" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">教育网站</div></td><td width="20%"><div align="center" id="Tdiv_2" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">电脑丛书</div></td><td width="20%"><div align="center" id="Tdiv_3" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">新出图书</div></td><td width="20%"><div align="center" id="Tdiv_4" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">其他</div></td></tr></tr><tr><td width="20%"><div align="left" id="Div1" class="menu" onmouseover="keepstyle(this)" onmouseout="hidediv(this)"><a href="#">北京大学</a><br><a href="#">北京航空航天大学</a><br><a href="#">北京工商大学</a></div></td></table></body></html>
回复讨论(解决方案)
<script> function divControl(show) { window.event.concelBubble = true;//只有IE支持此写法 var objID = event.srcElement.id;//只有IE支持此写法 var index = objID.indexOf("_"); var mainID = objID.substring(0, index); var numID = objID.substring(index + 1); if (mainID == "Tdiv") { if (show == 1) { showdiv(document.getElementById("Div" + numID)) } else { hidediv(document.getElementById("Div" + numID)) } } } var nbottom = 0, speed = 2, timerID=null; function displayMenu(obj) { nbottom += speed; if (nbottom <= 100) { timerID = setTimeout(function () { displayMenu(document.getElementById(obj.id)); }, 0); } else clearTimeout(timerID);}function showdiv(obj) { obj.style.display = "block"; //obj.style.clip = "rect(0 0 0 0)"; nbottom = 5; displayMenu(obj);}function hidediv(obj) { nbottom = 0; obj.style.display = "none";}function keepstyle(obj) { obj.style.display = "block";}</script>
<script> function divControl(show) { window.event.concelBubble = true;//只有IE支持此写法 var objID = event.srcElement.id;//只有IE支持此写法 var index = objID.indexOf("_"); var mainID = objID.substring(0, index); var numID = objID.substring(index + 1); if (mainID == "Tdiv") { if (show == 1) { showdiv(document.getElementById("Div" + numID)) } else { hidediv(document.getElementById("Div" + numID)) } } } var nbottom = 0, speed = 2, timerID=null; function displayMenu(obj) { nbottom += speed; if (nbottom <= 100) { timerID = setTimeout(function () { displayMenu(document.getElementById(obj.id)); }, 0); } else clearTimeout(timerID);}function showdiv(obj) { obj.style.display = "block"; //obj.style.clip = "rect(0 0 0 0)"; nbottom = 5; displayMenu(obj);}function hidediv(obj) { nbottom = 0; obj.style.display = "none";}function keepstyle(obj) { obj.style.display = "block";}</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">.menubar{position:absolute;top:10px;width:100px;height:20px;cursor:default;border-width:1px;border-style:outset;color:#00CCCC;background:#99CC33}.menu{position:absolute;top:32px;width:140px;display:none;border-width:2px;border-style:outset;border-color:#FFFFFF;background:#99CC33;padding:15px}.menu A{text-decoration:none;color:#00FF66}.menu A:hover{color:#FF6666}</style><script language="javascript">function divControl(show){window.event.concelBubble=true;var objID=event.srcElement.id;var index=objID.indexOf("_");var mainID=objID.substring(0,index);var numID=objID.substring(index+1); if(mainID=="Tdiv"){ if(show==1){ showdiv(document.getElementById("Div" + numID)); }else{ hidediv(document.getElementById("Div" + numID)); } } }var nbottom=0,speed=2;function displayMenu(obj){//obj.style.clip="rect(0 100% "+nbottom+"% 0)";nbottom+=speed;if(nbottom<=100){timerID=setTimeout("displayMenu("+obj.id+")");}else clearTimeout(timerID);}function showdiv(obj){obj.style.display="block";//obj.style.clip="rect(0 0 0 0)";//nbottom=5;//displayMenu(obj);}function hidediv(obj){nbottom=0;obj.style.display="none";}function keepstyle(obj){obj.style.display="block";}</script><title>无标题文档</title></head><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="0" style="font-size:15px"><tr><td width="20%"><div align="center" id="Tdiv_1" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">教育网站</div></td><td width="20%"><div align="center" id="Tdiv_2" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">电脑丛书</div></td><td width="20%"><div align="center" id="Tdiv_3" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">新出图书</div></td><td width="20%"><div align="center" id="Tdiv_4" class="menubar" onmouseover="divControl(1)" onmouseout="divControl(0)">其他</div></td></tr></tr><tr><td width="20%"><div align="left" id="Div1" class="menu" onmouseover="keepstyle(this)" onmouseout="hidediv(this)"><a href="#">北京大学</a><br><a href="#">北京航空航天大学</a><br><a href="#">北京工商大学</a></div><div align="left" id="Div2" class="menu" onmouseover="keepstyle(this)" onmouseout="hidediv(this)"><a href="#">北京大学</a><br><a href="#">北京航空航天大学</a><br><a href="#">北京工商大学</a></div></td></table></body></html>
一开启
obj.style.clip="rect(0 0 0 0)";
IE8测试就没反应,查了msdn,也没找到为啥

Alat AI Hot

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool
Gambar buka pakaian secara percuma

Clothoff.io
Penyingkiran pakaian AI

Video Face Swap
Tukar muka dalam mana-mana video dengan mudah menggunakan alat tukar muka AI percuma kami!

Artikel Panas

Alat panas

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1
Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6
Alat pembangunan web visual

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas

HTML sesuai untuk pemula kerana mudah dan mudah dipelajari dan dapat melihat hasilnya dengan cepat. 1) Keluk pembelajaran HTML adalah lancar dan mudah dimulakan. 2) Hanya menguasai tag asas untuk mula membuat laman web. 3) Fleksibiliti yang tinggi dan boleh digunakan dalam kombinasi dengan CSS dan JavaScript. 4) Sumber pembelajaran yang kaya dan alat moden menyokong proses pembelajaran.

HTML mentakrifkan struktur web, CSS bertanggungjawab untuk gaya dan susun atur, dan JavaScript memberikan interaksi dinamik. Ketiga melaksanakan tugas mereka dalam pembangunan web dan bersama -sama membina laman web yang berwarna -warni.

Anexampleofastartartingtaginhtmlis, yangbeginsaparagraph.startingtagsareessentialinhtmlasttheyinitiateelements, definetheirtypes, andarecrucialforstructuringwebpagesandconstructionthedom.

WebDevelopmentReliesOnhtml, CSS, andjavascript: 1) HtmlStructuresContent, 2) CSSStylesit, dan3) JavaScriptaddsInteractivity, Formingthebasisofmodernwebexperiences.

Algoritma Adaptif Kedudukan Y-Axis untuk Fungsi Anotasi Web Artikel ini akan meneroka cara melaksanakan fungsi anotasi yang serupa dengan dokumen perkataan, terutama bagaimana menangani selang antara anotasi ...

Giteepages Statik Laman Web Penggunaan Gagal: 404 Penyelesaian Masalah dan Resolusi Ralat Semasa Menggunakan Gitee ...

HTML, CSS dan JavaScript adalah tiga tiang pembangunan web. 1. HTML mentakrifkan struktur laman web dan menggunakan tag seperti, dan sebagainya. 2. CSS mengawal gaya laman web, menggunakan pemilih dan atribut seperti warna, saiz font, dan lain-lain.

Untuk mencapai kesan penyebaran dan membesarkan imej sekitarnya selepas mengklik pada imej, banyak reka bentuk web perlu mencapai kesan interaktif: klik pada imej tertentu untuk membuat sekitar ...
