Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 03-06-2012, 12:15 PM
Junior Member
 
Join Date: 03-06-12
Posts: 8
iTrader: 0 / 0%
Image Swap Java Script x2

Hey guys,

Long time reader first time poster. I just had a question about a Java script I am trying to use.

Basically its an image swap script. I have an image that is properly swapping at the top of the page, however I want to use it once more on another image. I am not a java guy - I tried playing with it with a few diff combos of duplicating the code and it just blows out everything. If anyone could tell me how to do multiple instances of swapping on the same page that would rock. Also if there is a better script out there I am open to that too. Thanks in advance!

The script can be found here: (Cant post it because I dont have 15 posts...)
Here is the code:
This goes in the header:
Quote:
<script language="JavaScript1.1">
<!--


var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages[i]=new Image()
slideimages[i].src=slideshowimages.arguments[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>
This goes in the body:
Quote:
<a href="javascript:gotoshow()"><img src="" name="slide" border=0 width=300 height=375></a>
<script>
<!--

//configure the paths of the images, plus corresponding target links
slideshowimages("food1.jpg","food2.jpg","food3.jpg ","food4.jpg","food5.jpg")
slideshowlinks("")

//configure the speed of the slideshow, in miliseconds
var slideshowspeed=2000

var whichlink=0
var whichimage=0
function slideit(){
if (!document.images)
return
document.images.slide.src=slideimages[whichimage].src
whichlink=whichimage
if (whichimage<slideimages.length-1)
whichimage++
else
whichimage=0
setTimeout("slideit()",slideshowspeed)
}
slideit()

//-->
</script>
<p align="center"><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="">JavaScript
Kit</a></font></p>
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WTS : Java script Facebook Apps, update status, send wall, send image, send video.etc sinuwun Content 3 12-17-2010 12:03 PM
frameset image swap HELP chuco61 Web Design Lobby 2 10-17-2008 09:09 PM
java script problem. 1st image not showing CircleOfLinks Web Design Lobby 2 09-18-2008 07:17 AM
php image swap script (needed) DroidTweak Coding Forum 8 11-27-2006 11:23 AM
Can a 'swap image' graphic contain image mapping? lizbeth Coding Forum 2 04-22-2004 02:32 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:08 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.