473,395 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

_HELP Modifying Script Create Random Linked Image Blend Script

1
I have been trying to modify a script that i had working in the past but have lost..

ORIGINAL URL:
http://www.thescripts.com/forum/thread147097.html

STEPS:
I want it to do the following:
1-Load a Random Image each time page loads or is refreshed / script starts (with corresponding url link when clicked)
2-Images change by blend/fade into one another, on an adjustable time delay
3-Next image loaded also loads new corresponding url/link
4-That the Images loaded are selected randomly from either a source directory or via file locations entered and not in same sequence as are the corresponding urls..

Below is the script so far:

PLEASE ANSWER IN LAYMANS TERMS QUOTING FULL SCRIPT AS I AM A NOVICE!

Many Thanks!

SCRIPT:

Here's the code:

Expand|Select|Wrap|Line Numbers
  1. <HEAD>
  2.  
  3. <script language="JavaScript1.1">
  4. <!--
  5.  
  6. //specify interval between slide (in mili seconds)
  7. var slidespeed=3000
  8.  
  9. //specify images
  10. var slideimages=new Array("image1.gif","image2.gif","image3.gif")
  11.  
  12. //specify corresponding links
  13. var slidelinks=new Array("http://www.whatever.com","http://whatnever.com","http://www.always.com")
  14.  
  15. var newwindow=1 //open links in new window? 1=yes, 0=no
  16.  
  17. var imageholder=new Array()
  18. var ie=document.all
  19. for (i=0;i<slideimages.length;i++){
  20. imageholder[i]=new Image()
  21. imageholder[i].src=slideimages[i]
  22. }
  23.  
  24. function gotoshow(){
  25. if (newwindow)
  26. window.open(slidelinks[whichlink])
  27. else
  28. window.location=slidelinks[whichlink]
  29. }
  30.  
  31. //-->
  32. </script>
  33.  
  34. </HEAD>
  35.  
  36. <BODY>
  37.  
  38. <a href="javascript:gotoshow()"><img src="image1.gif" name="slide"
  39. border=0 style="filter:blendTrans(duration=3)" width=97
  40. height=100></a>
  41.  
  42. <script language="JavaScript1.1">
  43. <!--
  44.  
  45. var whichlink=0
  46. var whichimage=0
  47. var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 :
  48.  
  49. function slideit(){
  50. if (!document.images) return
  51. if (ie) document.images.slide.filters[0].apply()
  52. document.images.slide.src=imageholder[whichimage].src
  53. if (ie) document.images.slide.filters[0].play()
  54. whichlink=whichimage
  55. whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
  56. setTimeout("slideit()",slidespeed+blenddelay)
  57. }
  58. slideit()
  59.  
  60. //-->
  61. </script>
  62.  
  63. [color=blue]
  64. >//specify images
  65. >var slideimages=new Array("image1.gif","image2.gif","image3.gif")[/color]
  66.  
  67. function shuffle(arr) {
  68. for (var i = arr.length - 1; i > 0; i--) {
  69. // Interchange element i with a random element not after it
  70. var j = Math.floor((i + 1) * Math.random());
  71. var t = arr[i];
  72. arr[i] = arr[j];
  73. arr[j] = t;
  74. }
  75. }
  76.  
  77. shuffle(slideimages);

I Cant get it to do steps 1-4
ANY HELP THANKS..
Oct 7 '07 #1
1 1944
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

What happens so far? Do you get errors?

Please use code tags when posting code:
[CODE=javascript]
JavaScript code here...
[/code]
Oct 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: bhennon | last post by:
Hey all, I have a small php script that calls a random image at the following page. http://www.2006ymcanationals.com/random.php IT WORKS IF I go directly to the above link. I am trying to...
2
by: yvan | last post by:
I was wondering if someone here could help me with modifying this PHP template so that it does something very specific for me. My knowledge of PHP is very limited (I'm more of a Cold Fusion...
4
by: Kim | last post by:
Random image downloader for specified newsgroup. Hi I'm writing a small script that will download random images from a specified newsgroup. I've imported yenc into the script but I can't open the...
9
by: koschwitz | last post by:
Hi, I hope you guys can help me make this simple application work. I'm trying to create a form displaying 3 circles, which independently change colors 3 times after a random time period has...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.