Results 1 to 5 of 5

Thread: CMotion Gallery Script Question

  1. #1
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default CMotion Gallery Script Question

    1) Script Title: CMotion Image Gallery

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

    3) Describe problem: I'm not actually having a problem with the script since everything seems to be working fine, but I do have one small question. When the full sized image opens in the pop up window, it's scaled to 95% and there's white around the image. I can't figure out why it doesn't just fill the whole window and I know I have the dimensions correct. Does it have something to do with this part of the script?

    function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
    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=no"
    window.open(path,"", winattributes)
    }
    My largest image width is 500px and the largest height is also 500px, but every time the window opens there is white space around the image and I need to click it to make it fill the window. Is there any way to change this? I tried making those dimentions larger, but nothing different happened. If you need to see it in action you can temporarily find it here. It's just a test page, so it will be removed once I get it working the way I want. I'm sure the rest of my coding isn't perfect, but I'm not a professional web designer and I don't really expect it to be.

    Also, I noticed the Text and Image Crawler script mentioned in another thread here. Can pop-up enlarged images be added to that too? I like the continuous scroll on that one better than the "End of Gallery" thing on the CMotion script.

    Thanks in advance!

  2. #2
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Does anyone have any suggestions on how to fix this? It's a minor problem and I suppose I'll just leave it as is, if not.

    Thanks anyhow.

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

    Different browsers handle images launched into pop up windows in different ways.

    You could generate a page via javascript or a server side language to place in the new window so as to format the position of the image and remove any margins or padding from around it. Or just make up a page in ordinary HTML for each larger image for the same purpose.

    However, though all these have been done and work, none of them are real simple. And it will be blocked by some browsers. A better approach would be to use something like Lightbox. If you use version 2.04 or better, you won't even need to worry about any onclick events, just setup your images' links with the lightbox syntax.

    Lightbox 2.04 (current version 2 page actually, may be updated - at this writing it is version 2.04):

    http://www.lokeshdhakar.com/projects/lightbox2/
    - John
    ________________________

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

  4. #4
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thank you for the advice and link. The strange margins around the images are showing up in both IE8 and Firefox even though I have another pop up script on a different part of the site which leaves no margin at all around them. I just couldn't figure out what the difference was between this one and that.

    I've never used Lightbox before, but I'll certainly take a look! If I can't figure that out, maybe I will just go with html. I appreciate your help and suggestions!

  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

    I just couldn't figure out what the difference was between this one and that
    Which illustrates my point that it is not exactly simple.

    The problem with pop ups is that they will be blocked in some browsers. This has nothing to do with the version of the browser or what kind it is, rather its pop up settings.

    As I say, there are several approaches to formatting an image into a page before launching it into a pop up. These have nothing to do with pop ups in general having the vulnerability I've mentioned.

    All pop ups are vulnerable to blocking.
    - John
    ________________________

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

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
  •