pagey

Javascript pageY issue with Microsoft Edge browser

时光总嘲笑我的痴心妄想 提交于 2019-12-10 09:23:17
问题 I want to create a simple script that will detect if user mouse leave window. Solution is already described here by using mouseout event. The problem with this solution is that it will trigger action also if user goes with mouse to scroller. So I added extra if condition e.pageY < jQuery(window).scrollTop() to this code: addEvent(document, "mouseout", function(e) { e = e ? e : window.event; var from = e.relatedTarget || e.toElement; if ((!from || from.nodeName == "HTML") && e.pageY < jQuery

jQuery (Swipe vs. Touch) pageX and pageY keep returning 0

大兔子大兔子 提交于 2019-12-08 23:03:17
问题 I'm playing with touchstart and touchend events on my iPhone. I built a sample page that has div that if you touch it and scroll the page, it should return the y coordinates of the start and end positions. link: http://jsbin.com/ibemom/2 the jQuery: var touchStartPos; $('.theDiv') .bind('touchstart', function(e){ touchStartPos = e.pageY; }) .bind('touchend', function(e){ alert(touchStartPos + ' | ' + e.pageY) }) When I load that page on my iPhone, however, the alert keeps reporting both

jQuery (Swipe vs. Touch) pageX and pageY keep returning 0

﹥>﹥吖頭↗ 提交于 2019-11-30 02:23:22
I'm playing with touchstart and touchend events on my iPhone. I built a sample page that has div that if you touch it and scroll the page, it should return the y coordinates of the start and end positions. link: http://jsbin.com/ibemom/2 the jQuery: var touchStartPos; $('.theDiv') .bind('touchstart', function(e){ touchStartPos = e.pageY; }) .bind('touchend', function(e){ alert(touchStartPos + ' | ' + e.pageY) }) When I load that page on my iPhone, however, the alert keeps reporting both values as zero. Anyone see anything wrong with what I have? UPDATE: I stumbled across this bit of code in