onmousedown

mouseover while mousedown

╄→尐↘猪︶ㄣ 提交于 2019-11-27 01:55:37
问题 I have a large table with with each cell being 25x25 and a div inside each one. Each div has the class of "node" and a background colour is applied to them all. I'm in the process of writing some jQuery code that will change the colour of each div when the mouse goes over it while the mouse button is down. I currently have it so it works when I mouse over, but I only want it working when the mouse button is down aswell. I have tried many different ways to get it to work but so far I have had

does mousedown /mouseup in jquery work for the ipad?

牧云@^-^@ 提交于 2019-11-26 19:18:01
问题 I am using the current code: $('body').mousedown(function() { $('div#extras').fadeTo('fast', 1); }); $('body').mouseup(function() { $('div#extras').delay(2000).fadeTo(1500, 0); }); This works great in safari but when I upload it and check it out on the ipad it doesnt work? 回答1: I found out how to do this for the ipad for those who are interested: Instead of the code I used in my question, you would use: $('body').bind( "touchstart", function(e){ $('div#extras').fadeTo('fast', 1); }); & $(