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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onMouseover for link does not work?

    Can someone pls advise me why this doesn't seem to work?

    <a title="MyLink" href="http://www.theurl.com" onMouseover="window.location=this.href" target="_blank">

    I'm trying to use onMouseover to open up the link in a new page, without the visitor having to actually click on the link itself.

    I used this on a blog site.

    So I'm not sure if is something inherently wrong with my inline-code.

    Or could it be due to a master CSS (by the webmaster) which is overwriting inline onmouseover attributes?

    TIA for any suggestions!

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by binary0018 View Post
    Can someone pls advise me why this doesn't seem to work?

    <a title="MyLink" href="http://www.theurl.com" onMouseover="window.location=this.href" target="_blank">

    I'm trying to use onMouseover to open up the link in a new page, without the visitor having to actually click on the link itself.

    I used this on a blog site.

    So I'm not sure if is something inherently wrong with my inline-code.

    Or could it be due to a master CSS (by the webmaster) which is overwriting inline onmouseover attributes?

    TIA for any suggestions!
    The target attribute is ignored because the link isn't being clicked, and the code you're executing is not associated with the operation of the link.

    You could try: onMouseover="if(this.click)this.click()", but it's a silly thing to do in any case.


  •  

    Posting Permissions

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