612wharfavenue Posted March 27, 2011 Share Posted March 27, 2011 I want an element to respond onclick, but only when its in a certain part of the screen, like a 'active area'. Does anyone know of any built in functions or methods that can do this? The element is capable of being moved about the page, and i would like its onclick event only to be active when its entirely within the designated 'box', which is invisible. Link to comment Share on other sites More sharing options...
birbal Posted March 27, 2011 Share Posted March 27, 2011 i am not aware about any any built in mehtods but you can do something like this.you can create a function which will take the x and y co-ordinate of the movable elementcheck those co-ordinates against some predefined co-ordinate (criteria fixed by you) of that element where it iss clickableif criteria matches do some jobnow you can bound the function to any event eg. onclick int that element. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.