JQuery mouseover/mouseout Function - Better Code?
Is there a better way to write the Following code?
I am using Aloha Editor and in my jQuery, any elements with the class
editable will get a 3px dashed border on mouseover, the code below is
working fine, and I am just wanting to know if there is a "best practice
or a better way" to write this code:
$(function(){
$('[class^="editable"]').mouseover(function(){
$(this).css('border','3px dashed #a7a7a7');
});
$('[class^="editable"]').mouseout(function(){
$(this).css('border','0px dashed #ffffff');
});
});
No comments:
Post a Comment