熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

利用腳本做的圖片來回滑動

2022-06-13   來源: .NET編程 

  前台代碼

  <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
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.