10/10/2018, 00:03
Nhờ các chuyên gia js giúp dùm
Mình viết 1 đoạn code hiển thị 2 banner chạy 2 bên trang web(code này ở trên mạng, mình chôm về chứ ko phải tự viết vì trình độ js chỉ là beginner). Kết quả trên IE 6,7 chạy ok nhưng firefox thì nó đứng yên một chỗ. Help me!Link test: http://bcci.diaoconline.vn
PS: mình viết trên ASP.net 2.0 dùng masterpage , Asp.net ajax...
PS: mình viết trên ASP.net 2.0 dùng masterpage , Asp.net ajax...
Bài liên quan





<DIV style="position: absolute; display: nonex; left: 5px; width: 110px; height: 110px;" id=Left_reporterHandle> quảng cáo bên trái</DIV> <DIV style="position: absolute; display: nonex; right: 5px; width: 110px; height: 110px;" id=Right_reporterHandle>quảng cáo bên phải</DIV> <SCRIPT> function residentFunction() { document.getElementById("Right_reporterHandle").style.top=document.body.scrollTop+480; document.getElementById("Left_reporterHandle").style.top=document.body.scrollTop+480; } setInterval("residentFunction();",100); </SCRIPT>Cái code trên không giúp chuyển động chậm dần đều mà chỉ là chuyển động đều thôi
Mà quái ở chỗ nó chẳng báo lỗi js gì cả, mở error console ra trống trơn, không biết phải mò chỗ nào...
Mình làm luôn phần quản lý các quảng cáo của trang này. Để có thể thay đổi các banner treo mình tạo một cái array trong code behind và dùng js để đọc. Sau đó duyệt qua mảng và dùng innerHTML để write ra cái thẻ div chứa banner đó.
Mình nghĩ có lẽ nó bị chỗ này... Ai đã từng làm xin chỉ giáo....
Anyway, Cảm ơn các bạn đã quan tâm, và giúp đỡ.Thanks a lot!
<script type="text/javascript">list_submenu(4)</script> <Script language="Javascript"> function ShowLeftAdDiv() { if (document.body.clientWidth > 900) { document.write("<table width=110 border=0 cellspacing=0 cellpadding=0><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=59' target='_blank'> <image src='image/t1.gif' width='110' /></a></td></tr><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=63' target='_blank'> <image src='image/t2.gif' width='110' /></a></td></tr><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=60' target='_blank'> <image src='image/t3.gif' width='110' /></a></td></tr><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=59' target='_blank'> <img src='image/t4.gif' width='110' /></a></td></tr></table>"); } } function ShowRightAdDiv() { if (document.body.clientWidth > 900) { document.write("<table width=110 border=0 cellspacing=0 cellpadding=0><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=56' target='_blank'> <image src='image/t5.gif' width='110' /></a></td></tr><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=62' target='_blank'> <image src='image/t6.gif' width='110' /></a></td></tr><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=79' target='_blank'> <image src='image/t7.gif' width='110' /></a></td></tr><tr><td align=center style='padding-bottom:1px;'><a href ='redirect.php?id=59' target='_blank'> <img src='image/t8.gif' width='110' /></a></td></tr></table>"); } } </Script> <DIV id=divAdLeft style="DISPLAY: none; POSITION: absolute; TOP: 0px"> <script language="JavaScript">ShowLeftAdDiv();</script> </DIV> <DIV id=divAdRight style="DISPLAY: none; POSITION: absolute; TOP: 0px"> <script language="JavaScript">ShowRightAdDiv();</script> </DIV> <SCRIPT language=JavaScript> window.onresize=ShowAdDiv; function FloatTopDiv() { startRX = document.body.clientWidth - 110 , startRY = 62; startRX_left = 0; var d = document; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; el.sP=function(x,y){this.style.left=x;this.style.top=y;}; el.x = startRX; el.y = startRY; return el; } function ml_left(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; el.sP=function(x,y){this.style.left=x;this.style.top=y;}; el.x = startRX_left; el.y = startRY; return el; } window.stayTopRight=function() { if (document.documentElement && document.documentElement.scrollTop) var pY = document.documentElement.scrollTop; else if (document.body) var pY = document.body.scrollTop; if (document.body.scrollTop > 105){startRY = 3;} else {startRY = 0;}; ftlObj.y += (pY+startRY-ftlObj.y)/16; ftlObj.sP(ftlObj.x, ftlObj.y); setTimeout("stayTopRight()", 1); } window.stayTopLeft=function() { if (document.documentElement && document.documentElement.scrollTop) var pY = document.documentElement.scrollTop; else if (document.body) var pY = document.body.scrollTop; if (document.body.scrollTop > 105){startRY = 3;} else {startRY = 0;}; ftlObj_left.y += (pY+startRY-ftlObj_left.y)/16; ftlObj_left.sP(ftlObj_left.x, ftlObj_left.y); setTimeout("stayTopLeft()", 1); } ftlObj = ml("divAdRight"); ftlObj_left = ml_left("divAdLeft"); stayTopLeft(); stayTopRight(); } function ShowAdDiv() { var objAdDivRight = document.getElementById("divAdRight"); var objAdDivLeft = document.getElementById("divAdLeft"); if (document.body.clientWidth < 980) { objAdDivRight.style.display = "none"; objAdDivLeft.style.display = "none"; } else { objAdDivRight.style.display = "block"; objAdDivLeft.style.display = "block"; FloatTopDiv(); } } ShowAdDiv(); </SCRIPT>bựa quá
bác nào xem hộ cái chatbox của em ở www.vuiha.net liệu có sửa đc ko