Update: A more accessible hover function.
I did my homework, then did this:
// a more accessible hover function
jQuery.fn.extend({
hover: function(fnOver, fnOut) {
return this.bind('mouseenter mouseover focus',
fnOver).bind('mouseleave mouseout blur', fnOut);
}
With jQuery 1.2.2 you can now bind multiple events at once. Just
separate them with a space. I'd also suggest using the new mouseenter
and mouseleave events.
$('a')
.bind(mouseenter focus mouseleave blur,
function(event) { console.log(event.type); });
--
Brandon Aaron
On Feb 3,
$('mySelector').mouseover(function() {
// do something on mouseover and focus
})
.focus(function(){
// trigger the mouseover event on focus
$(this).trigger('mouseover')
});
On Feb 4, 7:31 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
... at least, that's what I think I need to do!
Thanks a million, Brandon - and for your blog, which I'm keeping
permanently open!
Doing as you suggested above wouldn't put the 'up' image back on
mouseout (my syntax was probably wrong), though I did manage to get it
working by doing it the long way . Then I rewrote the core :/
Ooohh, that's neat!
Blimey, I'm learning a lot
Thanks, Hamish :)
On Feb 3, 8:01 pm, Hamish Campbell [EMAIL PROTECTED] wrote:
$('mySelector').mouseover(function() {
// do something on mouseover and focus})
.focus(function(){
// trigger the mouseover event on focus
5 matches
Mail list logo