Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Script has no name - sequential image load on page load

  1. #1
    Join Date
    Mar 2007
    Posts
    66
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Script has no name - sequential image load on page load

    The script has no name but can be found at:

    http://www.dynamicdrive.com/forums/s...ead.php?t=8136

    It was posted by jscheuer1.

    I would like to know if it is possible to link the images to pages within the site.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Try this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    
    <noscript><img src="files/1_side.jpg"></noscript>
    <script type="text/javascript">
    function robin(){
    //Set Your Images in the below Array:
    var robin_im=['files/1_side.jpg', 'files/2_side.jpg', 'files/3_side.jpg', 'files/5_side.jpg', 'files/8_side.jpg']
    
    //set the links in the below Array:
    var robin_link=['about.html', 'test.php', 'files/3_side.jpg', 'files/5_side.jpg', 'files/8_side.jpg']
    
    //////////////// Stop Editing //////////////////
    function createCookie(name,value,days) {
    	if (days) {
    		var date = new Date();
    		date.setTime(date.getTime()+(days*24*60*60*1000));
    		var expires = "; expires="+date.toGMTString();
    	}
    	else var expires = "";
    	document.cookie = name+"="+value+expires+"; path=/";
    }
    
    function readCookie(name) {
    	var nameEQ = name + "=";
    	var ca = document.cookie.split(';');
    	for(var i=0;i < ca.length;i++) {
    		var c = ca[i];
    		while (c.charAt(0)==' ') c = c.substring(1,c.length);
    		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    	}
    	return null;
    }
    
    function eraseCookie(name) {
    	createCookie(name,"",-1);
    }
    var num=readCookie('robim')? readCookie('robim')*1 : 0;
    document.write('<a href="'+robin_link[num]+'"><img src="'+robin_im[num]+'"></a>')
    num=num<robin_im.length-1? num+1 : 0;
    createCookie('robim', num);
    }
    robin();
    </script>
    
    </body>
    </html>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Mar 2007
    Posts
    66
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Yes ... thank you ... but am I supposed to do something with

    document.write('<a href="'+robin_link[num]+'"><img src="'+robin_im[num]+'"></a>')

    The images appear in order on page load .... please look at the code

    thank you for your time

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by vkbarefoot View Post
    Yes ... thank you ... but am I supposed to do something with

    document.write('<a href="'+robin_link[num]+'"><img src="'+robin_im[num]+'"></a>')
    No, just add your urls to the robin_link Array and that's it. I simply highlighted the part you listed above to show what else I changed in the script.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Mar 2007
    Posts
    66
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Actually, after publishing it - it looks and works great ... thank you

    the site i'm working on is http://www.vikibarefoot.com/Nash

  6. #6
    Join Date
    Mar 2007
    Posts
    66
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Robin Script

    http://www.dynamicdrive.com/forums/s...function+robin

    I love these scripts. I do sites for professional artists and this is a stunning element to ad to their home pages.

    I wonder why I am getting a blue or purple border around the images. It wasn't that way on the other site and I can't seem to fix it.

    Thank you ... I love this site ...

  7. #7
    Join Date
    Mar 2007
    Posts
    66
    Thanks
    7
    Thanked 0 Times in 0 Posts

  8. #8
    Join Date
    Jul 2007
    Location
    California
    Posts
    177
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Very cool looking website... I almost hate looking at others sites because they make mine look bad!!!

    If you're messing around with images, you may want to peek at this Smashing Magazine article. They are something I'd like to use at some point, but I just don't do enough with images yet. I plan on using a few when I put up the "fun stuff" portion of my site, funny photos etc... Take a peek: http://www.smashingmagazine.com/2007...ws-lightboxes/

  9. #9
    Join Date
    Jul 2007
    Location
    California
    Posts
    177
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    One other side note... Your e-mail addresses when I click them try and force me to use yahoo e-mail to contact you. Not everyone has a yahoo account.

    Check out this script: http://www.dynamicdrive.com/emailriddler/

    One other nice benefit is that it hides your e-mail address. Apparently from what I've read, harvesting bots snag your e-mail and then you get spammed to death. Granted you may want your e-mail visible to your clients, but I'd prefer to just use the "click here to e-mail me" thing. The only negative of course, is if they don't have a default e-mail editor. "shrug"

  10. #10
    Join Date
    Mar 2007
    Posts
    66
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Thanks for the Email Riddler

    Thanks for both the sites ... I'm sure I'll find a use for the image one at some point.

    Do you use the emailriddler? You said that it brings up a screen to send a Yahoo email. When I click on it - it brings up a screen to send and Outlook message.

    I guess it has to go somewhere!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •