SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please help my fix this simple (if you know how) error

    http://page-test.co.uk/loading.html

    The script is supposed to display a loading image attached to the mouse cursor.

    There are two problems:
    (1) when you submit the form by entering text in the box and pressing enter (not clicking the button) the image is not attached to the mouse but is positioned in the top-left corner (I think it just displays next in line with the HTML).
    (2) If you press the button but don't move the mouse the same problem occurs as mentioned in 1.

    It seems as though it doesn't attach to the mouse until the mouse is moved. Maybe it could attach to the form input that the enter button was pressed in, or the button that was clicked if the mouse needs to be moved?

    I've not bothered posting on the website of the script creator as some posts haven't been answered since February.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It isn't binding the code to determine the mouse position until after it calls show(). That line needs to be moves so as to bind it in the constructor rather than in the show call.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    I've tried that but it still struggles when you submit a form by entering text and pressing the enter button.


Bookmarks

Posting Permissions

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