473,763 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

_HELP Modifying Script Create Random Linked Image Blend Script

1 New Member
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 1972
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

What happens so far? Do you get errors?

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

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

Similar topics

12
9709
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 call that in another page so that i get a random image the page is http://2006ymcanationals.com/index.php using <img
2
1657
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 developer), which is why I'm inquiring here. Anyways, first I'll show you the PHP code, and then I'll explain what kind of modification I need to have applied: ------------------------------------------------------------------------------ <?
4
3082
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 image or save it. This is my first script so be gentle! Heres the script ####random group downloader#### import nntplib import string, random import mimetools import StringIO
9
5066
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 passed. I'm struggling with making the delegate/invoke thing work, as I know GUI objects aren't thread-safe. I don't quite understand the concept I'm supposed to use to modify the GUI thread-safe. Below is my form and my Circle class. Currently,...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10145
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9822
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.