前台代碼
<div id=soutu>
<div id=zhuan>這裡只是放一張圖片而已
<img alt= src=/Images/ajpg width= height= />
</div>
</div>
<div id=tuzi>這裡調用腳本函數
<a # onmousemove=showLink() class=aTaohang></a>
<a # onmousemove=showLink()class=aTaohang></a>
<a # onmousemove=showLink() class=aTaohang></a>
<a # onmousemove=showLink() class=aTaohang></a>
</div>
腳本這裡可我做成一個JS文件放在前台調用這樣就方便點
var time = windowsetInterval(luen() );
function showLink(num) {
windowclearTimeout(time);
if (num == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height= /></div>
}
if (num == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
if (num == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
if (num == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
}
function out() {
time = windowsetInterval(luen() );
}
var tmp = ;
function luen() {
tmp++;
if (tmp == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
else if (tmp == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
else if (tmp == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
else if (tmp == ) {
documentgetElementById(soutu)innerHTML = <div id=zhuan ><img src=/DataImages/jpg width= height=/></div>
}
else {
tmp = ;
}
}
function showbuy(divId) {
documentgetElementById(divId)styledisplay = block;
}
function disbuy(divId){
documentgetElementById(divId)styledisplay = none;
}
樣式
aTaohang
{
display: block;
float: left;
fontsize: px;
fontweight: ;
color: White;
backgroundcolor: Gray;
width: px;
height: px;
textalign: center;
margin: px;
textdecoration: none;
}
aTaohang:hover
{
color: Gray;
backgroundcolor: White;
}
From:http://tw.wingwit.com/Article/program/net/201311/13355.html