javascript popup using html "map" tag?

Discussion in 'Javascript' started by Mosher, Mar 25, 2005.

  1. Mosher

    Mosher Guest

    Hi all, is there a good way to have a popup window appear using Javascript
    and the html "map" tag? Here is my code:

    <map name="navigation">
    <area shape="rect" coords="5,57,45,70" href="index.php" alt="Home">
    </map>

    I would like to have this link be a Javascript "onclick" type popup function
    with no scrollbar, etc.

    Thanks,

    Mosher
    Mosher, Mar 25, 2005
    #1
    1. Advertising

  2. Mosher

    kaeli Guest

    In article <>,
    enlightened us with...
    > Hi all, is there a good way to have a popup window appear using Javascript
    > and the html "map" tag? Here is my code:
    >
    > <map name="navigation">
    > <area shape="rect" coords="5,57,45,70" href="index.php" alt="Home">
    > </map>
    >
    > I would like to have this link be a Javascript "onclick" type popup function
    > with no scrollbar, etc.
    >


    Not the best solution in the world by any means, but it should work for most
    people:

    <area shape="rect" coords="5,57,45,70" href="javascript:window.open
    ('index.php','','height=400,width=
    400,toolbar=no,scrollbar=no,resizable=yes'" alt="Home">

    Note that people who use tabbed browsers and prefer to middle-click to open
    links in tabs will hate you. ;)

    I'm not sure if the area element supports onClick, but this would be a better
    solution if it does: (I'm too lazy right now to go look; I just woke up
    *LOL*)

    <area shape="rect" coords="5,57,45,70" href="index.php" onClick="window.open
    ('index.php','','height=400,width=
    400,toolbar=no,scrollbar=no,resizable=yes';return false;" alt="Home">

    That way, clicking on the link would open in a new window for left-clicks,
    but people middle-clicking or right-clicking or people without script enabled
    could still use it as they desired.

    --
    --
    ~kaeli~
    You can't have everything. Where would you put it?
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Mar 28, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dapkniht
    Replies:
    1
    Views:
    1,321
    Eliyahu Goldin
    Mar 8, 2006
  2. shruds
    Replies:
    1
    Views:
    757
    John C. Bollinger
    Jan 27, 2006
  3. Replies:
    1
    Views:
    364
    Andrew Thompson
    Nov 29, 2006
  4. Rajesh
    Replies:
    0
    Views:
    520
    Rajesh
    Jul 31, 2007
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    502
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page