0

I want to implement navigation in a website using the middle button function of scrolling ("clicking" (please re-read clicking) the middle button and roaming around the borders) but I would like this to happen instantly without the need for user input. Something of the kind:

 $(element).mouseover(function(){
            roamAround(); //I've tried SIMULATING (NOT <--- DETECTING)
                         //a middle-click from the mouse but failed
});

I am currently using google-chrome and at this stage of development I am not really concerned about cross-browsing this function. If it should work on chrome then it's fine. What would be the best way to do this using native functions or emulation? Thank you very much!

EDIT: I don't want to DETECT user input, please re-read the question :)

user3050963
  • 265
  • 1
  • 3
  • 8
  • 1
    Please refer to this, this answers your question. http://stackoverflow.com/questions/5833928/jquery-alert-when-middle-mouse-button-clicked – Denver William Dec 08 '13 at 19:28
  • has nothing to do with my question xD re-read my question please – user3050963 Dec 08 '13 at 19:32
  • This is how you would detect a middle click: http://stackoverflow.com/a/4007656/2827555 – hkk Dec 08 '13 at 19:46
  • 1
    What he wants is Google Maps but without clicking. He just wants the gesture of moving the mouse - essentially an infinite scroller – Deryck Dec 08 '13 at 19:50
  • This is the best one I can find so far, most of the ones provided pre-made are for WordPress for some reason lol http://jscroll.com/ - you'll have to probably duplicate the objects so you can capture vertical AND horizontal gesturing. I love the idea though hope I see the final product in the wild some day – Deryck Dec 08 '13 at 19:53
  • @Deryck thank you for trying Deryck! What I am really aiming for is something of this kind http://scripterlative.com/files/dragscroll.htm but without the need to press and drag, just drag the mouse around :p I guess I'll have to develop my own, thank you very much again! :) – user3050963 Dec 08 '13 at 20:01

1 Answers1

0

Sounds like you want, like Deryck said, infinite scrolling. There's a jQuery plugin jScroll that does a simpler version for vertical content that can either be auto-loaded or loaded by a button press. You can view the code on Github to see how to do something similar, i.e. your roamAround function could mimic the _load function found there.

Community
  • 1
  • 1
millertime
  • 23
  • 5