I am tring to make a hover function, which on hover, unbinds a previous binded function.
But I don't think I understand what the jquery website is trying to explain.
Please see my attempt in this jsfiddle. http://jsfiddle.net/motocomdigital/S9uVh/
This is my binded function which runs fine...
$("h1.trunc").bind().shorten({
width: 300,
tail: '...',
tooltip: false
});
But I am then trying to .unbind() it when my element is hovered, but the re-bind it on my second hover alternation...
$('#element').hover(
function () {
$(this).find("h1.trunc").unbind();
$(this).animate({
height : '100px'
}, 200 );
},
function () {
$(this).find("h1.trunc").bind().shorten({
width: 300,
tail: '...',
tooltip: false
});
$(this).animate({
height : '20px'
}, 200 );
}
);
Can someone help me fix this please. Also is there a way of not having to re-write the entire "h1.trunc" function again inside my hover function.
Please see working jsfiddle here. Thanks in advance.
overflow: visable;tooverflow: visible;