Results 1 to 3 of 3

Thread: Thumbnailer Viewer II - Add Pop Up ?

  1. #1
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thumbnailer Viewer II - Add Pop Up ?

    1) Script Title: Thumbnail Viewer II

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

    3) Describe problem: I would like to know how to get the larger thumbnail that appears and rotates to pop up in a seperate window via javascript so it can be resized with no scrollbars, etc. I tried fiddling with this part of the script:
    Code:
    imageHTML='<a href="'+dest+'" target="_blank" return false>'+imageHTML+'</a>'
    Target _blank and _new will open a new window, if I do anything on the lines of onClick or javascriptpen.window I find myself getting errors and the whole script stalling. Thanks in advance for any help!

    http://209.85.173.132/search?q=cache...lnk&cd=2&gl=us

    This is a thread that I believe was trying to go the same direction and he said he got his working, but I don't see anything in the script involving a popup window at all.. just a note. D:

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,440
    Thanks
    78
    Thanked 3,443 Times in 3,404 Posts
    Blog Entries
    12

    Default

    If you want to insert an onclick event in there, you must respect proper syntax in escaping delimiters. Take for example (the original line):

    Code:
    imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
    The delimiters are the red single quotes ('). They show where a string begins or ends. Now if you were to put in an onclick event that requires single quotes, they would have to be escaped with a slash (\) so that the script interpreter knows that the string hasn't ended:

    Code:
    imageHTML='<a href="'+dest+'" onclick="alert(\'Hey!\');">'+imageHTML+'</a>'
    But, with complex code, this can get quite confusing to the human eye. Fortunately, a window.open command doesn't need that many single quote delimiters if written in a way that takes advantage of the link element's properties, ex:

    Code:
    imageHTML='<a href="'+dest+'" target="_blank" onclick="window.open(this.href, this.target, \'width=250, height=200, top=100, left=150\'); return false;">'+imageHTML+'</a>'
    - John
    ________________________

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

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

    Cody J (02-06-2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you !

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
  •