效果如圖:
原以為用firebug把頁面主要代碼搞下來后或許會(huì)產(chǎn)生些錯(cuò)誤,結(jié)果沒想到弄下來后啥錯(cuò)誤都沒有。。呵呵。。。只要把樣式也搞下來就行了。。
效果網(wǎng)址:http://www.5mdn.com/adtest.htm
HTML頁面代碼:

原以為用firebug把頁面主要代碼搞下來后或許會(huì)產(chǎn)生些錯(cuò)誤,結(jié)果沒想到弄下來后啥錯(cuò)誤都沒有。。呵呵。。。只要把樣式也搞下來就行了。。
效果網(wǎng)址:http://www.5mdn.com/adtest.htm
HTML頁面代碼:
<!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> <title></title> <style type="text/css"> /* 全局CSS定義 */ body { font: 12px/20px simsun; color: #333; margin: 0; } div, form, img, ul, ol, li, dl, dt, dd, h1, h2 { margin: 0; padding: 0; border: 0; } div, img, input, select, ul, dl, dt, dd { float: left; } h2 { display: inline; } ul { list-style-type: none; } a { text-decoration: none; color: #333; } a:hover, div a:hover, .Alc dt a:hover { text-decoration: underline; color: #f60; } /* 顏色屬性 */ .bai12 { color: #fff; } .hui6 { color: #666; } .hui9 { color: #999; } .hoc { color: #c00; } .lan12, .fa a, fia a { color: #36c; } .fal { font-family: arial; } .hoc12, .ho14b, .ho12b { color: #c00; } .lan12, .lan12i, .fa a, .lan14b, .lan14, .fia a, .A_back, .lan14bi { color: #36c; } .fi, .lan12i, .fia a, .A_back, .lan14bi { text-decoration: underline; } .b { font-weight: bold; } /* 滾動(dòng)廣告樣式 */ .Am_1 { width: 540px; position: relative; } .Am_1 img { padding: 1px; border: 1px solid #D0E1F0; } .Am_1 ul { position: absolute; width: 135px; top: 0; right: 0; border-top: 1px solid #BED5EC; line-height: 16px; } .Am_1 li { width: 115px; padding: 11px 10px; height: 33px; float: left; background: url(http://icon.zol-img.com.cn/zol_mall/index/0905/a1.gif); } .Am_1 li.act { padding-left: 18px; height: 34px; background-position: 0 -60px; margin: -1px 0 -1px -8px; position: relative; color: #c00; } .Am_1 li.act a { color: #c00; } .Am_1 li.act a:hover { color: #f60; } </style> </head> <body> <div class="Am_1"> <div style="width: 406px; height: 220px;" id="fc"> <div style="display: none;"> <a title="佳能500D 1510萬像素 超值套裝低價(jià)搶購" target="_blank" > <img border="0" src="http://admin.zol.com/article/picture/module/6_module_images/389.jpg" onmouseout="setAuto()" onmouseover="clearAuto();" /></a></div> <div style="display: block;"> <a title="技嘉M1022中關(guān)村商城首發(fā)" target="_blank" > <img border="0" src="http://admin.zol.com/article/picture/module/6_module_images/386.gif" onmouseout="setAuto()" onmouseover="clearAuto();" /></a></div> <div style="display: none;"> <a title="GARMIN 610 中關(guān)村商城 超低價(jià)促銷" target="_blank" > <img border="0" src="http://admin.zol.com/article/picture/module/6_module_images/388.gif" onmouseout="setAuto()" onmouseover="clearAuto();" /></a></div> <div style="display: none;"> <a title="卡巴斯基 全功能安全軟件2010(三年版)" target="_blank" > <img border="0" src="http://admin.zol.com/article/picture/module/6_module_images/378.jpg" onmouseout="setAuto()" onmouseover="clearAuto();" /></a></div> </div> <ul id="show_text"> <li class=""><span onmouseout="setAuto()" onmouseover="clearAuto();Mea(0);"><a title="佳能500D 1510萬像素 超值套裝低價(jià)搶購" target="_blank" > 佳能500D 1510萬像素 超值套裝低價(jià)搶購</a></span></li><li class="act"><span onmouseout="setAuto()" onmouseover="clearAuto();Mea(1);"><a title="技嘉M1022中關(guān)村商城首發(fā)" target="_blank" > 技嘉M1022中關(guān)村商城首發(fā)</a></span></li><li class=""><span onmouseout="setAuto()" onmouseover="clearAuto();Mea(2);"> <a title="GARMIN 610 中關(guān)村商城 超低價(jià)促銷" target="_blank" > GARMIN 610 中關(guān)村商城 超低價(jià)促銷</a></span></li><li class="" style="margin-top: 0px;"><span onmouseout="setAuto()" onmouseover="clearAuto();Mea(3);"><a title="卡巴斯基 全功能安全軟件2010(三年版)" target="_blank" > 卡巴斯基 全功能安全軟件2010(三年版)</a></span></li></ul> </div> <script type="text/javascript"> var n = 0; var obj = document.getElementById("show_text"); var fc = document.getElementById("fc"); function Mea(v) { n = v; setBg(v); plays(v); } function setBg(v) { for (var i = 0; i < 4; i++) { if (v == i) { obj.getElementsByTagName("li")[i].className = "act"; if (v == 3) { obj.getElementsByTagName("li")[3].style.marginTop = "-2px"; } else { var p = obj.getElementsByTagName("li")[3].style.marginTop; if (p == "-2px") { obj.getElementsByTagName("li")[3].style.marginTop = "0px"; } } } else { obj.getElementsByTagName("li")[i].className = ""; } } } function plays(v) { try { with (fc) { filters[0].Apply(); for (var i = 0; i < 4; i++) { (i == v) ? children[i].style.display = "block" : children[i].style.display = "none"; } filters[0].play(); } } catch (e) { var d = document.getElementById("fc").getElementsByTagName("div"); for (var j = 0; j < 4; j++) { (j == v) ? d[j].style.display = "block" : d[j].style.display = "none"; } } } function clearAuto() { clearInterval(autoStart); } function setAuto() { autoStart = setInterval("auto()", 2000); } function auto() { n++; if (n >= 4) n = 0; Mea(n); } setAuto(); </script> </body> </html>
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
