开发者

How to change an HTML Link Value using JavaScript?

I have an HTML page where I want to change Image & Link with at regular interval of time. I have following code in Head Tag :

<sctipt>
var slideimages=new Array()
var slidelinks=new Array()
var text = document.getElementById('slidetext')

function slideshowimages(){
  for (i=0;i<slideshowimages.arguments.length;i++){
  slideimages[i]=new Image()
  slideimages[i].src=slideshowimages.arguments[i]
  text.innerHTML = textChange.aruguments[i]
  }
}

function slideshowlinks(){
  for (i=0;i<slideshowlinks.arguments.length;i++)
  slidelinks[i]=slideshowlinks.arguments[i]
}

function gotoshow(){
  if (!window.winslide||winslide.closed)
    winslide=window.open(slidelinks[whichlink])
  else
    winslide.location=slidelinks[whichlink]
    winslide.focus()
}
</script>

And Following Code in Body Tag :

<script>
slideshowimages("D:/Search/images/back1.jpg", "D:/Search/images/back2.jpg", "D:/Search/images/back3.jpg","D:/Search/images/back4.jpg","D:/Search/images/back5.jpg","D:/Search/images/back7.jpg")
slideshowlinks("http://wsabstract.com", "http://dynamicdrive.com", "http://java-scripts.net","http://stackoverflow.com","http://superuser.com","http://serverfault.com")
textChange("wsaabstract","dynamicdrive","java-script","stackoverflow","superuser","serverfault")


var slideshowspeed=3000
var whichlink=0
var whichimage=0

function slideit(){
  if (!document.images)
    return
    document.images.slide.src=slideimages[whichimage].src
    document.getElementById('slidetext').innerHTML=text.value
    whichlink=whichimage

  if (whichimage<slideimages.length-1开发者_如何学运维)
    whichimage++
  else
    whichimage=0
    setTimeout("slideit()",slideshowspeed)
}
</script>

The Images are changing regularly but only when I have not used the text label that is "slidetext" (which is also hyperlink). But, Using text label, image & text become steady. So, what should be modification to change image & text at regular interval.


text.innerHTML = textChange.aruguments[i]

Normal the fault in your code ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜