I cannot see proper structure of the code; in particular, setting the event handlers. Besides, you can setup two handlers by the
.hover
method — both "mouse in" and "mouse out":
$(document).ready(function () {
hoverElement = $(#share);
$(hoverElement).hover(
function () {
},
function () {
}
);
});
Please see:
http://api.jquery.com/hover/[
^].
Can you see the difference? The
.hover
handlers are added in the handler of
document.ready
, which provides right order of execution.
Besides, you can use a JavaScript debugger to check up two things: 1) if the handler is added, 2) if the handler is triggered.
—SA