www.webdeveloper.com
Results 1 to 7 of 7

Thread: Image map and openWindow

  1. #1
    Join Date
    Jul 2003
    Posts
    5

    Image map and openWindow

    Hi:
    I really need someone's help here.
    I'm trying to add an openWindow to an image map I created in Imageready:
    Here the code:

    <img src="images/contact_nav.gif" width="290" height="116" border="0" usemap="#contact_nav_Map">
    <map name="contact_nav_Map">
    <area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html">
    </map>

    Now If I want a window to open on click on the area, but with a specific size, no toolbars and so on, where would I add the javascript? In the head, orin the tag itself? Both? AHHHHHH. Help,please.

    Thanks
    am

  2. #2
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    If you create a function called openwindow() in the head section then you should just be able to put:

    <area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html" onclick="openwindow();return false;">
    Every fight is a food fight when you’re a cannibal.

  3. #3
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,123
    change this line to
    <area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html">

    <area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html" onclick="return OpenWin(this)">

    an in the head section of the page add the following code

    <script type="text/javascript">
    function OpenWin(obj){
    var newWin = window.open(this.href,'newWin',"width:400,height=200,scrollbars=no,location=no");
    return false;
    }
    </script>
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  4. #4
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    You could also try using target="_blank" to open it in a new window for those who have Javascript enabled; although, you would not be able to configurate the options.

    [J]ona
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

  5. #5
    Join Date
    Jul 2003
    Posts
    5

    THANKS

    Great!
    I'll try it out.

    Thank you very much.
    am

  6. #6
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,123

    Re: Image map and openWindow

    Originally posted by am89

    but with a specific size, no toolbars and so on, where would I add the javascript? In the head, orin the tag itself? Both? AHHHHHH. Help,please.

    Thanks
    am
    Hey Jona..I guess you missed that part..
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  7. #7
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Oops!!

    [J]ona
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles