Move mouse position automatically to specific section on website

Discussion in 'Programming' started by henryp18, Aug 18, 2013.

  1. #1
    How can I achieve this? I want it so when a page loads, it automatically moves the mouse to a specific div or area on the website.
     
    henryp18, Aug 18, 2013 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,818
    Likes Received:
    4,536
    Best Answers:
    123
    Trophy Points:
    665
    #2
    check out javascripts focus() method
     
    sarahk, Aug 18, 2013 IP
  3. henryp18

    henryp18 Member

    Messages:
    113
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #3
    Can you provide the script?
     
    henryp18, Aug 18, 2013 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,818
    Likes Received:
    4,536
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Aaah, no, but its not hard, especially if your site already has jquery loaded.

    Depends on what you want the focus to be, normally an input field. What did you want the focus to be?

    The other alternative (just in case I'm overthinking this) is that you simply have

    <a name='jumpspot'></a>
    Code (markup):
    and then your link is page.html#jumpspot
     
    sarahk, Aug 18, 2013 IP
  5. henryp18

    henryp18 Member

    Messages:
    113
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #5
    This would be a sales page, so if a user were to come to this page. The mouse should automatically hover over the button, or buy now link I have, as soon as the page loads.
     
    henryp18, Aug 18, 2013 IP
  6. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #6
    If I understand your question, you want to move the actual mouse pointer to a specific spot/element? If so, that is not possible in Javascript, not even with HTML5.

    The only thing you can do with Javascript is to set focus to elements, move the selection cursor to a specific spot or actually select text.
     
    ThePHPMaster, Aug 18, 2013 IP
  7. sarahk

    sarahk iTamer Staff

    Messages:
    28,818
    Likes Received:
    4,536
    Best Answers:
    123
    Trophy Points:
    665
    #7
    And it would piss me right off!
    I don't mind if it was, say, help text showing me where something is, but a buy button? Would seem pushy or desperate.

    Look for a more user friendly way of encouraging sales.
     
    sarahk, Aug 18, 2013 IP