View Single Post
  #24  
Old 10-14-2003, 07:29 PM
  august's Avatar 
august august is offline
 

Senior Member
  
Join Date: Jul 2003
Posts: 178
 

Default Re: .

Quote:
Originally Posted by raxitpatel
I want it keep changing without refreshing the page at all - like - www.dvddhamaka.com - But in that website it only shows selcted images whereas I want all the images somewhere in home_main.tpl or on side colum with or without title.
.

This is more or less what they did :

<html>
<head>
<title>Image and Link Slide Show</title>
<SCRIPT LANGUAGE="JavaScript">
var a=0
var count=0

// Set this variable to the speed at which you want the images to change. The speed is in milliseconds.
var speed=10000


// Enter your images Here along with the directory if need be.
var imgs=new Array()
imgs[0]="owls3.jpg"
imgs[1]="hawks2.jpg"
imgs[2]="pic221.jpg"
imgs[3]="eagle1.jpg"

// Enter your URLS and what you want to go in the ALT property. This is so when they mouse over the image
// There will be a small description of the Image or URL. Make sure you separate them with an
// ampersand "&" so that the script can separate them out before writing out the link.
var urls=new Array()
urls[0]="http://www.urlhere.com&NameofFileHere"
urls[1]="http://www.urlhere.com&NameofFileHere"
urls[2]="http://www.urlhere.com&NameofFileHere"
urls[3]="http://www.urlhere.com&NameofFileHere"

// Array used for preloading
var myimages=new Array()
// Preload First Image
myimages[a]=new Image()
myimages[a].src=imgs[a]
count++

// This is the function that rotates the images and links. You should not have to modify it.
function Doimglink()
{
// window.status=a
newurls=urls[a].split("&")
if(document.layers)
{
document.mydiv.document.write("[img]"+imgs[a]+"[/img]")
document.mydiv.document.close()
}
if(document.getElementById)
{
elm=document.getElementById("mydiv")
elm.innerHTML="[img]"+imgs[a]+"[/img]"
}
a++
if(a>imgs.length-1)
{a=0}
// Preload the next image
if(count<imgs.length)
{
myimages[a]=new Image()
myimages[a].src=imgs[a]
count++
}
setTimeout("Doimglink()",speed)
}

// In the DIV below you may have to add the top and left properties to the style tag to position it
// correctly in the window. You must keep it positions as absolute for it to work in NS4.0+ browsers.

</SCRIPT>
</head>
<body onLoad="Doimglink()">
<CENTER><H1>Slide Show With Links</H1>
<DIV ID='mydiv' STYLE="position:absolute;top:120;left:200"></DIV>
</body>
</html>
Reply With Quote