
Untitled
By: a guest on
Aug 1st, 2012 | syntax:
None | size: 1.04 KB | hits: 11 | expires: Never
Converting function variables to global variables after keypress and mouse click
$(document).keydown(function(e){ //keyboard bind
if( e.keyCode == 39 ){//right (->)
if($('.selectstyle').hasClass("selectstyle")){
$margins = -180;
} else ($(".select" ).hasClass("select")){
$margins = 0;
}
}
});
$offset = (-220 + $margins),
window.varName = "foo";
$(document).keydown(function(e){ //keyboard bind
if( e.keyCode == 39 ){//right (->)
if($('.selectstyle').hasClass("selectstyle")){
window.$margins = -180;
} else ($(".select" ).hasClass("select")){
window.$margins = 0;
}
}
});
$offset = (-220 + $margins),
var $margins;
$(document).keydown(function(e){ //keyboard bind
if( e.keyCode == 39 ){//right (->)
if($('.selectstyle').hasClass("selectstyle")){
$margins = -180;
} else ($(".select" ).hasClass("select")){
var $margins = 0;
}
}
});
$offset = (-220 + $margins),