Results 1 to 9 of 9

Thread: AutoLoad Image Thumbnail Viewer

  1. #1
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AutoLoad Image Thumbnail Viewer

    Script: Image Thumbnail Viewer
    Link: http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

    problem:

    referr to: http://www.catalinaudrey.com/index3.html

    i try to make the 'welcome' to Automatically loaded(showed) when visitors come, so the default page would be like when 'Welcome' is clicked.

    so far i try <body onload=loadimage('link')>;

    but not successful.

    please help...

    thank you.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Since welcome is your first rel="thumbnail" link, you can just add this (red) to the init function in the thumbnailviewer.js file:

    Code:
    init:function(){ //Initialize thumbnail viewer script by scanning page and attaching appropriate function to links with rel="thumbnail"
    if (!this.enableAnimation)
    this.opacitystring=""
    var pagelinks=document.getElementsByTagName("a")
    for (var i=0; i<pagelinks.length; i++){ //BEGIN FOR LOOP
    if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="thumbnail"){ //Begin if statement
    if(!window.opera&&!pagelinks[i].attachEvent)//added to remove outline stlye in FF
    this.dotask(pagelinks[i],function(){this.style.outlineStyle='none'},'mouseover') //"
    pagelinks[i].onclick=function(){
    if(!window.opera){//added to remove outline stlye in FF
    this.blur();
    this.style.outlineStyle='';
    }
    thumbnailviewer.stopanimation() //Stop any currently running fade animation on "thumbbox" div before proceeding
    thumbnailviewer.loadimage(this) //Load image
    return false
    }
    this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link
    } //end if statement
    } //END FOR LOOP
    //Reposition "thumbbox" div when page is resized
    this.dotask(window, function(){if (thumbnailviewer.thumbBox.style.visibility=="visible") thumbnailviewer.centerDiv(thumbnailviewer.thumbBox)}, "resize")
    
    this.targetlinks[0].onclick.apply(this.targetlinks[0]);
    } //END init() function
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you!

    After 48+ hours of Googling for it...

    Feel like it is a magic after applying your code

    Thanks jscheuer1!

  4. #4
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default applying some space on the top of the page

    because now i can do autoload of image, some time the image will cover the navigation menu (depend on screen setting).

    my question is, how to apply some space on the top of the page so that i can display menu on the top of the page and the image will show below the menu. -so the image will not cover the menu-

    i've just tried version 2 which has loadarea, my point is like having a loadarea.

    i wish i could program it myself, but am only good in copy and paste

    thanks.
    Last edited by catalinaudrey; 10-22-2007 at 04:25 PM.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are all kinds of ways to layout a page. Much would depend upon what you already have. A basic method is to put one thing int one division and follow it by another thing in another division, ex:

    HTML Code:
    <div>
    
    Menu goes here
    
    </div>
    
    <div>
    
    Other stuff goes here
    
    </div>
    If you need more help:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the link is http://www.catalinaudrey.com

    depending on the screen area setting, some people can not see the menu on the left because it is hidden by the image.

    thanks!

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

    Default

    sorry, but <div> doesn't seem to be working.

    i feel a bit guilty to say it as you tried to help but it doesn't work...

    thanks

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Don't feel badly. I did say it was basic, and that it would depend upon what you already have. However, I didn't even see a menu on the page you linked to (I used the link in your first post), because I must have had an old version cached. I see the situation now, and without getting into detail, I would suggest putting the menu horizontally across the top of the page with the image area beneath it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for the idea john,

    and for those who need to know how to set a space on top of the object, please refer to thumbnailviewer.js and look at the centerDiv function, i only change the value of the bolded number below...

    ...
    var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+100+"px" //Vertical position of div element: Either centered, or if element height larger than viewpoint height, 10px from top of viewpoint
    ...

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
  •