Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript mouse up android

Just want the position of the mouse on mouseup,

This works on a desktop but not an android browser:

<script type="text/javascript">

    var two = 0;

    window.onmouseup = gogo;
    function gogo(eve){
        two = eve.clientY;
        document.write(two);    
    }
</script>

I've tried several alternatives but haven't got the right answer.

Any clues?

This edit: I notice a delay on answering this post even though there are a lot of views. Am wondering what it is that makes this question so elusive.

like image 677
user2268083 Avatar asked Sep 22 '26 10:09

user2268083


1 Answers

You cannot hover in a mobile browser...

It depends on the requirement...

For Example..

  1. you have a dropdown menu list. when you hover on menu, submenu appears -> here the menu can also have a link..

         - Menu (a href="a.html")
             - submenu1 (a href="b.html")
             - submenu2 (a href="b.html")
             - submenu3 (a href="b.html")
    

For this you cannot use dropdown because on clicking menu *it redirects..*

WHAT YOU CAN DO IS

use alternatives like javascript or some CSS

For Javascript write script like on Menu click invoke some script and check if it is a mobile browser and handle whether to show submenu div or not

----> http://jsfiddle.net/pDp4T/11/ <-------

like image 199
ivar ajet Avatar answered Sep 24 '26 01:09

ivar ajet