Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Can I load images into a target frame using JS?

    Hello there,

    I have included a simple photo gallery in the website I am building, and the gallery pages consist of 3 frames as follows:

    Left frame = a Menu with thumbnail images
    Top right frame = the Gallery Title
    Bottom right frame = the "picture frame" in which I want a full-sized image to load when the corresponding thumbnail image is clicked.

    Using HTML, all of my images load into the target frame ("picture frame") when the thumbnails are clicked, but the images aren't positioned correctly (centered). Also, after an image has loaded, it has a lot of white-space surrounding it -- which is a problem since all of my pages have black backgrounds. An example is attached to my post.

    I have tried everything, but I have not had any success using html to fix the problem. Is there a JS that I can use to call images into the target frame and have them centered with a black background? Maybe I could use the onload event handler...? If so, I need the correct code, since I am just now learning how to use JS.

    Any advice would be much appreciated!

    Thanks,

    Richard
    Attached Images Attached Images

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    a link to the frameset would be better
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the input.

    I'm not sure that I understand exactly what you mean. A link to the frameset would be better than using the onload event handler? Would linking to the frameset allow me to force an image to load into the target frame centered with a black background?

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    a link to your code not a pic
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #5
    New to the CF scene
    Join Date
    May 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay thanks. Where would I put the link to the script? And what script would I need to use?


  •  

    Posting Permissions

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