Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How do I add a url to a slode show.
Old 01-25-2007, 03:21 AM How do I add a url to a slode show.
Skilled Talker

Posts: 79
Trades: 0
Hi to all, I have the follwing slideshow and would like to know if it is possible to add a url to the images.

URLs to add: /html/technical.asp
/html/books.asp

Code:
Code:
<script>
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 10000
// Duration of crossfade (seconds)
var crossFadeDuration = 3
var Pic = new Array()
Pic[0] = '/html/images/technical-files.gif'
Pic[1] = '/html/images/reference-books.gif'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
Cheers
Mally
malhyp is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-25-2007, 03:44 AM Re: How do I add a url to a slode show.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
For what it looks like, and if there is only 1 url for allthe pics, you should be able to enclose the slide show in a div, or a span, and add an onclick="javscript:top.location='{yourUrl}';" on that div/span.

Code:
<div id="slideShow" onclick="javascript:top.location='http://www.google.com';">
  <script type="text/javascript">
  runSlideShow();
  </script>
</div>
If you need an url per image, this will require more tweaking in the script.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-25-2007, 04:02 AM Re: How do I add a url to a slode show.
Skilled Talker

Posts: 79
Trades: 0
What if there are only two urls required for two images?
malhyp is offline
Reply With Quote
View Public Profile
 
Old 01-25-2007, 04:18 AM Re: How do I add a url to a slode show.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Well, then the script needs to be modified to not simply output an img tag, but an img inside an a tag.

I'm at work now, and don't have the time to modify the script.
If nobody has done it by this evening, I'll make a modded version then.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-26-2007, 06:07 PM Re: How do I add a url to a slode show.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
yargh.... I just saw that this code will only work in IE, and I'm on linux...
Better than hack it to make it work, try this one...

Much better and cross browser:
http://www.dynamicdrive.com/dynamici...nslideshow.htm
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-26-2007, 06:56 PM Re: How do I add a url to a slode show.
Skilled Talker

Posts: 79
Trades: 0
Thanks so much.

The new code is so much better. Image stops when you mouse over which is what I was realy looking for.

How silly of me, I looked at that code a week ago and thought, no not the one. Uses two images.

Thanks for your help.

Mally
malhyp is offline
Reply With Quote
View Public Profile
 
Old 01-26-2007, 07:52 PM Re: How do I add a url to a slode show.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
No problems.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to How do I add a url to a slode show.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24587 seconds with 12 queries