Hello and welcome to our community! Is this your first visit?
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 2010
    Thanked 0 Times in 0 Posts

    event.clientx doesn't work in firefox

    hi -- someone wrote a script for me to simulate an image map on a background header in wordpress. it works great in chrome and ie, but not firefox. can someone pls. help? thx.

    <script type="text/javascript">
    function geturl() {
    if(myMouseX < 400) {
    return "http://www.alexandrazissu.com/az-blog/books/";
    else {
    return "http://www.alexandrazissu.com/az-blog/";

    and then the call:

    <div id="header-image" onclick="location.href = geturl();" style="cursor: pointer;">

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Behind the Wall
    Thanked 361 Times in 357 Posts
    I don’t see any reason why firefox should populate the event variable inside the function. for inline JavaScript you have to explicitly pass the event variable (same as the this variable).
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


    Tags for this Thread

    Posting Permissions

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