Current location: Hot Scripts Forums » General Web Coding » JavaScript » random banner code with image and flash file


random banner code with image and flash file

Reply
  #1 (permalink)  
Old 06-30-08, 03:43 AM
sujata_ghosh sujata_ghosh is offline
Wannabe Coder
 
Join Date: May 2006
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
random banner code with image and flash file

hi to all!

I have 3 image file and 1 flash (swf) banner files , which i want to add using Java script, so that rotate one by one.

currently i am using this script to rotate banner:
Code:
<script language="JavaScript1.2">
 
var variableslide=new Array()
//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
variableslide[0]=['image file 1', 'url for image 1', '']
variableslide[1]=['image file 2', 'url for image 2', '']
variableslide[2]=['image file 3', 'url for image 3', '']


//configure the below 3 variables to set the dimension/background color of the slideshow
var slidewidth='468px' //set to width of LARGEST image in your slideshow
var slideheight='60px' //set to height of LARGEST iamge in your slideshow, plus any text description
var slidebgcolor='#F3F3F3'
//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=15000
////Do not edit pass this line////////////////
var ie=document.all
var dom=document.getElementById
for (i=0;i<variableslide.length;i++){
var cacheimage=new Image()
cacheimage.src=variableslide[i][0]
}
var currentslide=0
function rotateimages(){
contentcontainer='<center>'
if (variableslide[currentslide][1]!="")
contentcontainer+='<a onClick="javascript:setAction(\'13\');return true;" href="'+variableslide[currentslide][1]+'">'
contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">'
if (variableslide[currentslide][1]!="")
contentcontainer+='</a>'
contentcontainer+='</center>'
if (variableslide[currentslide][2]!="")
contentcontainer+=variableslide[currentslide][2]
if (document.layers){
crossrotateobj.document.write(contentcontainer)
crossrotateobj.document.close()
}
else if (ie||dom)
crossrotateobj.innerHTML=contentcontainer
if (currentslide==variableslide.length-1) currentslide=0
else currentslide++
setTimeout("rotateimages()",slidedelay)
}
if (ie||dom)
document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
if (document.layers)
document.slidensmain.visibility="show"
rotateimages()
}
if (ie||dom)
start_slider()
else if (document.layers)
window.onload=start_slider
</script>
<ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; bgColor=&{slidebgcolor}; visibility=hide><layer id="slidenssub" width=&{slidewidth}; left=0 top=0></layer></ilayer>

but can one give me some code or code url, by which i can randomazied all together images and flash.

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ad banner rotator randomization Anessa JavaScript 20 06-02-09 10:01 AM
does dynamic flash image display consume bandwidth? janicefernandes Flash & ActionScript 1 12-29-07 09:38 AM
File and Image Listing PHP Script, I need YOU oconkero Script Requests 1 02-28-07 03:18 AM
Code for opening a window to the size of the image jdsmith8 JavaScript 0 11-20-06 04:56 PM
Making a flash image a link Balkee867 Flash & ActionScript 4 08-02-05 05:10 PM


All times are GMT -5. The time now is 09:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.