Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 2 of 2 FirstFirst 1 2
Results 11 to 20 of 20
  1. #11
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Hey Pierrot,
    Well I ran your script and I went to the Javascript Console in Firefox and there was an error on line like 79 or somewhere around there - it seems like it's just a typo - there was just a line break where there shouldn't have been one -

    Change this:
    Code:
    	function random_imglink(){ v
    	ar myimages=new Array()
    to this:
    Code:
    	function random_imglink(){ 
    	var myimages=new Array()
    I fixed it and ran the new code and it worked perfectly. File is attached.
    Let me know if that helps!
    Heather
    choosy developers choose gif!
    website | paintings | blog

  2.  

  3. #12
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    choosy developers choose gif!
    website | paintings | blog

  4. #13
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Hello,
    Sorry I didn't have chance to check and relpy earlier...
    Raspberryh you are so sweet! Merci, merci, merci!
    It's working now! please just one more question- if I don't want to include link redirect (no click and go to onther page) can i delete without problem this:

    //specify corresponding links below
    var imagelinks=new Array()
    imagelinks[1]="http://www.wsabstract.com"
    imagelinks[2]="http://www.dynamicdrive.com"
    imagelinks[3]="http://www.java-scripts.net"
    and also if I have images in folder can I put:
    myimages[1]="pictures/img1.gif"
    thank you very much :-)

  5. #14
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Hi Pierrot,

    Quote Originally Posted by Pierrot
    if I don't want to include link redirect (no click and go to onther page) can i delete without problem this:

    //specify corresponding links below
    var imagelinks=new Array()
    imagelinks[1]="http://www.wsabstract.com"
    imagelinks[2]="http://www.dynamicdrive.com"
    imagelinks[3]="http://www.java-scripts.net"
    Yes, you can delete the part that you specified, but you'll also want to rewrite the html output. You need to remove the <a> tag. So, change this:
    Code:
    document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>' + captions[ry])
    to this:
    Code:
    document.write('<img src="'+myimages[ry]+'" border=0>' + captions[ry])
    Quote Originally Posted by Pierrot
    and also if I have images in folder can I put:
    myimages[1]="pictures/img1.gif"
    Yes you definitely can.

    Quote Originally Posted by Pierrot
    thank you very much
    No prob! Glad I could help
    choosy developers choose gif!
    website | paintings | blog

  6. #15
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    :-)
    It is working!
    Thank you very much for help.

    My best wishes

  7. #16
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Hi Raspberryh,

    Sorry to troubling you again. I cannot find a way myself.
    I would like to have this picture displayed in the first line (top line), then in the second line (just below the picture) 3-4words with its explanation, and the third line two words again (name of the author).
    Could you help me please to do it?
    Thank you so much

  8. #17
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Hey Pierrot,
    Sounds like you need to insert some line breaks (for the easiest way to do it).
    Well you can do it either of two ways...

    The quick & dirty way to do it would be to declare your captions like this:
    Code:
    captions[1] = "<br>explanation goes here<br>author goes here";
    So, just put the line breaks right into your captions.

    The better way to do it would be to declare a separate array for your author, and keep the formatting out of the variables. That way, if you need to change the formatting, you only have to change it in one place. You would do that like this:

    Code:
      var captions = new Array(); // (you can just keep this for your 'explanation')
      captions[1] = "caption for image 1 goes here";
      captions[2] = "caption for image 2 goes here";
      captions[3] = "caption for image 3 goes here";
    
      var authors = new Array()
      authors[1] = "author for image 1 goes here";
      authors[2] = "author for image 2 goes here";
      authors[3] = "author for image 3 goes here";
    Then change your write statement to:
    Code:
    document.write('<img src="'+myimages[ry]+'" border=0><br>' + captions[ry] + '<br>' + authors[ry])
    Hope that helped...
    Heather
    choosy developers choose gif!
    website | paintings | blog

  9. #18
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Hey Raspberryh,
    Yes that works very good! :-)
    Few lines of code and the display looks completely different.
    Thank you very much for helping.

  10. #19
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Hey no prob
    choosy developers choose gif!
    website | paintings | blog

  11. #20
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Hello Raspberryh
    Could I ask you one more question: how to make this sample working?
    I would like to display two different colours and two different sizes as billow. Would you have any idea how to do that?
    Thanks a lot.

    Painting: Village in Summer

    Author: Leonardo Da Vinci



Page 2 of 2 FirstFirst 1 2

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:49 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com