Results 1 to 5 of 5

Thread: Cmotion Gallery - Download Interrupt

  1. #1
    Join Date
    Dec 2005
    Location
    Foshan, Guangdong, China
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cmotion Gallery - Download Interrupt

    http://www.dynamicdrive.com/dynamici...iongallery.htm

    Hi John and thanks for this wonderful script. I have found a small bug that I wondered if you would be interested in having a look at it? I am using the continuously scrolling version of the cmotion gallery script + all latest tweaks

    If a surfer clicks on one of the gallery images before the complete gallery has downloaded, the expected javascript window appears as intended. Upon closing the new window, I find the gallery has stopped downloading when the pop-up window opened - and since it is not fully populated, the gallery will not revolve either

    I am explaining this badly - please have a look
    http://www.pearl-dragon.com/Furnitur...ure_Garden.htm
    is as good a page as any I guess, the site is in test and build mode at present

    I know that surfers will click an image as they wait for the whole gallery to download, and wondered if there was a way to either:
    1. Force the gallery to continue downloading after the javascript call
    2. Incorporate a 'loading bar' into the script

    I have tried the second option, but I was obviously not doing it correctly and ended up with many conflicts

    best wishes + many thanks
    Jonno

  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 this script already has a variable for checking the load state of the page, 'loadedyes', I'd first try something straightforward like:

    Code:
    function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
    if (loadedyes==0)
    return;
    var actualWidth=typeof optWidth!="undefined" ? optWidth : "600px" //set 600px to default width
    var actualHeight=typeof optHeight!="undefined" ? optHeight : "500px" //set 500px to  default height
    var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
    window.open(path,"", winattributes)
    }
    This should prevent the enlargeimage() function from opening a window until the images are loaded. If so, problem solved!

    BTW, you're welcome for any modifications of mine to this script that you are using but, I didn't write the original.
    - John
    ________________________

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

  3. #3
    Join Date
    Dec 2005
    Location
    Foshan, Guangdong, China
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hiya - you are correct in that this modification stops the enlargeimage () opening the window. Unfortunately the page download still stops, presenting the user with the appearance of a frozen screen. I did try adding
    if (loadedyes==0)
    return;
    else (loadedyes==1)

    But so far I cannot force the page download to continue regardless of whether an enlarheimage() window is called or not

    I am going to see if I can wrap this javascript inside a loading bar code, which keeps the gallery invisible untill the download is complete, and then call it with something like
    if (loadedyes==0)
    show gallery;

    Apologies, I am hopeless with code
    Oh, I am using xp and IE6 as default, and FF1 for secondary browser checking, plus the site is on a commercial host

    many thanks
    Jonno

  4. #4
    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

    You could also try changing every instance of:

    Code:
    href="javascript:enlargeimage('some.gif')"
    to:

    Code:
    href="javascript:if(loadedyes)enlargeimage('some.gif')"
    With this approach and the one I will mention below, you would not need the previous modification I mentioned.

    Yet another separate approach would be to make the gallery invisible until loaded. Put this code after the do not edit line in the script:

    Code:
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    document.write('<style type="text/css">#motioncontainer {visibility:hidden;}<\/style>')
    and this line after the loadedyes=1 statement in the fillup() function (addition red):

    Code:
    function fillup(){
    if (iedom){
    crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer
    menuwidth=parseInt(crossmain.style.width)
    mainobjoffset=getposOffset(crossmain, "left")
    cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery
    actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("trueContainer").offsetWidth
    
    crossmain.onmousemove=function(e){
    motionengine(e)
    }
    
    crossmain.onmouseout=function(e){
    stopmotion(e)
    showhidediv("hidden")
    }
    }
    loadedyes=1
    document.getElementById('motioncontainer').style.visibility='visible'
    if (endofgallerymsg!=""){
    creatediv()
    positiondiv()
    }
    }
    - John
    ________________________

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

  5. #5
    Join Date
    Dec 2005
    Location
    Foshan, Guangdong, China
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John - You are the man! I have gone with the final offering and kept the gallery hidden until loaded - it works a treat!

    Many thanks for your time and help, I very much appreciate it
    Jonno

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
  •