SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot poLka's Avatar
    Join Date
    Apr 2003
    Location
    GF
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with popup (advanced)

    hi all,

    could i get a hand with opening a new page in a popup window... have a page with a list of images and clicking an image should cause a new window to open with a template page that i have created. this template page only has one image in it (and some text). what i would like done is change the .src of that one image in the template page to the image defined by the thumbnail clicked. any ideas? is this a reasonable way of opening a new image in a window? cheers!

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    Fort Lauderdale
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This would be easiest with a server-side language. With Javascript you could have all your links call the pop-up function and send the function the image name. onClick="pop('img1.jpg');". The pop function will call the template page and in the query string add a variable with the image name. http://www.x.com/template.html?img=img1.jpg

    On the template page you will need to parse the url with javascript in order to get the value of img. In the body tag add onLoad="parseURL();". This function should get the value of img, then update your image src.

    For info on the query string function, read Beetle's post here.

    www.unpossiblemedia.com - A Fort Lauderdale based multimedia company.

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can use javascript; thus
    window.nameofwindow.document.getElementById("imgname").src=""newImagesrc

    I think that will work
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  4. #4
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I've just come here for something slightly more complicated. I have a main page, opener, that opens a maximum of three pop-ups. These all have animations that are syncronized to the opener. I have just managed to get the first pop-up to continue with the animation even when the main controller has closed ( the main controller is the opener ). What I need to do now is pass a function between the first new window to the second when the opener has been closed, so the second will then be syncronised to the first. Any suggestions?

    I just need the syntax for passing between 1 new window and another.
    Last edited by Markdidj; Jun 21, 2003 at 15:47.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


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
  •