Hi there folks,
started developing a jquery widget which takes all form elements and turns them into jquery style elements.
When I trigger mousenter (line 8-11) and after that blur (line12-15), variable "hover123123" (chose stupid name to make sure i don't use it anywhere) in blur event doesn't change (stays false).
However if I uncomment line 1 and comment line 7 (define hover123123 as global) it changes.
Any thoughts on why my variable doesn't change when it's a local variable?
Thx in advance
Here is my code:
-
//var hover123123 = false;
-
(function( $ ){
-
$.widget( "ui.input", {
-
...
-
_createSelectOne: function(){
-
...
-
var hover123123 = false;
-
this.container.bind( "mouseenter", function(){
-
$( "body" ).append( "Hover changed to true");
-
hover123123 = true;
-
});
-
control.bind( "blur", function(){
-
if( !hover123123 ){
-
$( "body" ).append( "Shouldn't happen after mousenter");
-
}
-
});
-
...
-
},
-
...
- }