Results 1 to 3 of 3

Thread: thumbnail viewer II: automatic width?

  1. #1
    Join Date
    Sep 2007
    Location
    west sacramento
    Posts
    25
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Question thumbnail viewer II: automatic width?

    1) Script Title: image thumbnail viewer II

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    3) Describe problem: for the pics that are loaded into the "loadarea", i have several that are of diffrent widths. is there a way to set the width of the "loadarea" so that it automatically equals the width of each individual image?

    i am asking because i have the description text (called by the "title" attribute) aligned right. since the current width of the "loadarea" is set at a constant number, the description text moves well beyond the right-edge of pics that have a smaller width.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It's possible, but it's a lot easier if this width isn't based on the width of each image, but rather, just a manual number you can optionally specify within the HTML:

    Code:
    <a href="http://www.nasa.gov/images/content/167040main_image_feature_738_ys_4.jpg" rel="enlargeimage::mouseover::900px" rev="loadarea::http://www.dynamicdrive.com" title="This is an example">Thumbnail Example 1</a><br />
    So the part in red is optional, and when defined, would cause the loaddiv to resize to 900px in width when the mouse rolls over this particular thumbnail link.

    To enable this, add the below lines in red to the original script:

    Code:
    if (linkobj.getAttribute("rel").split("::")[2])
    showcontainer.style.width=linkobj.getAttribute("rel").split("::")[2]
    showcontainer.innerHTML=imageHTML

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    radiofriendlybox (02-28-2008)

  4. #3
    Join Date
    Sep 2007
    Location
    west sacramento
    Posts
    25
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    It's possible, but it's a lot easier if this width isn't based on the width of each image, but rather, just a manual number you can optionally specify within the HTML:

    Code:
    <a href="http://www.nasa.gov/images/content/167040main_image_feature_738_ys_4.jpg" rel="enlargeimage::mouseover::900px" rev="loadarea::http://www.dynamicdrive.com" title="This is an example">Thumbnail Example 1</a><br />
    So the part in red is optional, and when defined, would cause the loaddiv to resize to 900px in width when the mouse rolls over this particular thumbnail link.

    To enable this, add the below lines in red to the original script:

    Code:
    if (linkobj.getAttribute("rel").split("::")[2])
    showcontainer.style.width=linkobj.getAttribute("rel").split("::")[2]
    showcontainer.innerHTML=imageHTML
    works perfect. thanks!

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
  •