SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2002
    Location
    canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    redirection/popup script

    ok, I'm posting here because I think it can be done in javascript.

    I have no idea what to call it.

    I want to allow the viewer to click on an image which will popup a new window to a page (abc.html). At the same time, the original page with the link image will redirect to a different page (123.html).

    Does anybody know how to get this done? Or can give me some sort of idea of what search terms I should use to search around?
    HostVoice.net - When Hosts Compete, You Win
    Looking for a web host? Let them compete for your business.
    Submit a free request and receive offers within 15 minutes
    from qualifying hosts - Personal, business, NT, dedicated!

  2. #2
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    that can be done with HTML,
    Code:
    <a href="abc.html" taget="_blank" onclick="this.location.href='123.html'">
    or using popup windows
    Code:
    <a href="123.html" onclick="window.open('abc.html','windowName','width=150,height=150,toolbar=no,location=no');">
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2002
    Location
    canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whoa..thanks...that worked

    I had used a javascript to popup window and put it in the form of the 2nd code, but didn't work so I thought directing both links need to be in javascript. I guess not.

    thanks again.
    HostVoice.net - When Hosts Compete, You Win
    Looking for a web host? Let them compete for your business.
    Submit a free request and receive offers within 15 minutes
    from qualifying hosts - Personal, business, NT, dedicated!

  4. #4
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Have you got your pop-up blockers on? that could be why your not getting them to work
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  5. #5
    SitePoint Zealot
    Join Date
    Nov 2002
    Location
    canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nono..sorry, I meant I had used a third-party javascript for a customized popup window, and then had typed up the code like your 2nd one but that didnt work. but if I use the window.open instead of 3rd party, then it works.

    edit: oh, now that I got it working, is there a way to center this without javascript? there doesn't seem to be any parameters for window.open
    HostVoice.net - When Hosts Compete, You Win
    Looking for a web host? Let them compete for your business.
    Submit a free request and receive offers within 15 minutes
    from qualifying hosts - Personal, business, NT, dedicated!

  6. #6
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is it the pop-up you want to center? For both methods you can use the window.moveTo(x,y), and window.resizeTo(w,h), and to get the screen size its screen.width and screen.height. Just abit of maths if you know your document size.......
    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
  •