Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts

    open in new window...

    I have this code for a table cell rollover, how do i make it open in a new window?

    <td onMouseOver="background='images/bar_bg_lightgray.jpg'" onClick="window.location='?j=home'" style="cursor:hand" onMouseOut="background='images/bar_bg.jpg'" width="10%" valign="middle">Home</td>

    Thanks
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    onClick="window.open='?j=home'"

    ?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was thinking the same thing, but it didnt work...
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    WA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Based on the above noted code you would need an anchor first:
    a href=
    Then you can place the onclick function in the anchor.

    a href="javascript:void(null);" onClick='window.open("home.htm","_blank","hotkeys=1,directories=1,toolbar=1,titlebar=1,status=1,loca tion=1,status=1,menubar=1,top=90,left=90,width=450,height=235,scrollbars=1,resizable=1");'
    Have a GREAT Ariel day!!
    Mike
    LittleAriel.com

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, that doesnt work...
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #6
    New Coder
    Join Date
    Aug 2002
    Location
    WA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by The Wizzard
    Sorry, that doesnt work...
    I put your code together with 2 images. What's not working is the background image swap onmouseover. Could you please post a link to what you have so far and then I should be able to fix it for you.
    Have a GREAT Ariel day!!
    Mike
    LittleAriel.com

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #8
    New Coder
    Join Date
    Aug 2002
    Location
    WA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tested it and it works:

    Code:
              <a href="javascript:void(null);" onclick='window.open("home.htm","0","0");'><TD onmouseover="background='images/bar_bg_lightgray.jpg'" 
              style="CURSOR: hand" onclick="window.location='?j=home'" 
              onmouseout="background='images/bar_bg.jpg'" width="10%" 
              background="Clan Internal Affairs_files/bar_bg.jpg">Home</TD></a>
    Please note that there's a space between java and script in the code above. This forum has put it there, not me. Don't forget to remove the space.

    You'll need to create the page home.htm and then designate how you want the window to display by changing the "0" parameters.

    Also, you won't be needing the other onclick command ( onclick="window.location='?j=home'" ) You could just remove it or leave it if you want but it won't serve any function.

    Good luck with your site, looks very nicely done so far
    Have a GREAT Ariel day!!
    Mike
    LittleAriel.com

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your help wontgetlost, but with your code, I was able to use a much simpler way...

    Instead of creating a home.htm page, and all that stuff, I simply took the code which I had


    <td onMouseOver="background='images/bar_bg_lightgray.jpg'" onClick="window.location='?j=home'" style="cursor:hand" onMouseOut="background='images/bar_bg.jpg'" width="10%" valign="middle">Home</td>


    And then took out the onClick function, and added this...


    <a href="http://www.enemydown.org/forum" target="_blank"><td background="images/bar_bg.jpg" onMouseOver="background='images/bar_bg_lightgray.jpg'" style="cursor:hand" onMouseOut="background='images/bar_bg.jpg'" width="10%">Forums</td></a>


    Thank you very much, your code made me think of this
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)


  •  

    Posting Permissions

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