javascript - How to do things to an element based on where the cursor comes from -
I hope the question is quite clear, I want to "things" for one object, where the cursor will come For example, if the slide cursor comes from the left side, make the element slide on the right, if the cursor comes from the right, at the top if it is coming down from the bottom and if it comes from the top I have tried to do it on my own, it was not so good, so I I'm not expected to show myself anything, sorry. But I have an example for you:
So, please tell me how to use jQuery and / or CSS3
You can get the entrance to block the direction of moving the mouse over that time. See examples:
function getMoveDir () {var direction = ''; If ((dx & gt; = 0) & amp; amp; (disy & lt; = 0)) {if (disx & lt; disy) {direction = 'right from'; } And (direction = 'from above';}} if ((dxxt = 0) & amp; amp; (disy & gt; = 0)) {if (disy> disx) {direction = 'below From ';} and {direction =' from left to '}} return direction;}
Comments
Post a Comment