Shadowing Posted October 24, 2012 Share Posted October 24, 2012 Hey guys I'm having a wierd issue that i cant quite understand. I have code that makes text appear and dissapear as you focus on itthe problem is the field dynamticly changes I have a map with a x and y axis and im displaying the x and y when a user focus on one it will go blank and then on blur display the axisthe problem is when i flip my map to another sector the X axis will be differant which displays fine but for some reason when i click on and then off it displays the axis number from the last sector. I'm assuming its because the function is still active from the last sector. so i have to like disable it some how $('#sector_input_x').on({ focus: function() { if (this.value === session_x) this.value = ''; }, blur: function() { if (this.value === '') this.value = session_x; } }); Link to comment Share on other sites More sharing options...
Shadowing Posted October 24, 2012 Author Share Posted October 24, 2012 if i use this before the on statement $('#sector_input_x').off(); then it disables it all together no longer works anymore Link to comment Share on other sites More sharing options...
justsomeguy Posted October 29, 2012 Share Posted October 29, 2012 If you add another handler at some point in the code it sounds like you need to remove the previous handlers first. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now