Results 1 to 10 of 10

Thread: generating popup windows

  1. #1
    Join Date
    Jun 2005
    Location
    San Jose, CA (home); Rochester, NY (school)
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default generating popup windows

    It's me again. Sorry if I'm being a pest, but I've got yet another script I can't get working. That's what you get when art students embark on web design I guess...

    Anyway, what I'm trying to do now is popup windows that show magnified images of thumbnails. Rather than code each popup into a different html document (there are almost 100 of them) I want to generate the popup code with javascript. I'm using the script found here as a guide.

    And this is what I've done.

    It just flat out doesn't work. But then again neither does the one on that other guy's site. Any ideas?

    Thanks so much,
    Stephanie

  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

    Here are two problems, there could be others:

    Code:
    <a href="#" onClick="magnify(Barcelona,LC1);">Click</a>
    When passing literal strings to a function, they must be delimited by appropriate quotes, in this case, single quotes ('). Also when using a link tag in this fashion, it is wise to return false onclick to prevent possible undesirable effects, so that your link would look like this:
    Code:
    <a href="#" onClick="magnify('Barcelona', 'LC1');return false;">Click</a>
    - John
    ________________________

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

  3. #3
    Join Date
    Jun 2005
    Location
    San Jose, CA (home); Rochester, NY (school)
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Thanks for the help. I applied those changes. However, the code still doesn't work. Any other tips?

    -Stephanie

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I can't tell what the problem is as you haven't fixed the string literals problem on the page you linked to yet.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jun 2005
    Location
    San Jose, CA (home); Rochester, NY (school)
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    I can't tell what the problem is as you haven't fixed the string literals problem on the page you linked to yet.
    It's up now.

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

    Well, it is working, just not displaying your picture. Here is the picture it wants to display:
    Code:
    http://www.nightwings.net/actual/products/graphics/cabinet-doors/applied-moulding/LC1.jpg
    I suspect there is no picture by that exact name at that exact location. Remember, capitalization counts as much as exact spelling. Oh, and 'return false;' has a space between the two words, you have it 'returnfalse;' This has nothing to do with the picture not displaying but will become important later when your page is longer. Without return false properly included in the code, the link will cause the page to scroll to the top.
    - John
    ________________________

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

  7. #7
    Join Date
    Jun 2005
    Location
    San Jose, CA (home); Rochester, NY (school)
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the picture exists on my computer, I just didn't bother to upload it. I'm not worried about that part yet. I just need to get the popup working. It's strange that it shows up for you as nothing happens when I click the link.

    I'm using Avant Browser/IE on Windows XP if that affects anything...

  8. #8
    Join Date
    Jun 2005
    Location
    San Jose, CA (home); Rochester, NY (school)
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, I'm a dork. It doesn't show up in IE/Avant because I had my pop-up blocker on. Sorry. However, is there any way to get Netscape to open a window of the size I specify or is it always just a full sized window?

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

    Oddly enough, I have been working on a similar idea but, am using a different implementation. A demo exists at:

    http://johsch7.farvista.net/opener6.htm

    If you want to view the source code, be aware that it is an ad supported site so everything except the opening <html> tag before the opening <head> tag is put there by the server. The script uses two pages, one to create the new window and one to display the images within the new window. Because of this, it is not blocked by pop-up stoppers (not the default settings in the IE and NS7 ones at least) so much. It works in IE6 and NS7 and FF. It doesn't work in Safari/Mac, at least not in a test by another member of this forum. For what you are trying to do, you may be happier with:

    http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

    from DD here. It uses a DHTML pop-up so it is not subject to blocking. It cannot render outside the browser window in the way that opening a new window can.
    - John
    ________________________

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

  10. #10
    Join Date
    Jun 2005
    Location
    San Jose, CA (home); Rochester, NY (school)
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Yes I saw a post about those other 2 methods yesterday. After seeing my script not work quite as planned yesterday, I was thinking I'd play around with those today. 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
  •