views:

91

answers:

1

Hi,

Im trying to replicate a simple hover effect in YUI just like you would with jQuery however its a little confusing. As in jquery it would go:

$('.hoverclass').hover(function() {
  $(this).addClass('up');
}, function() {
  $(this).removeClass('up');
});

Any pointers how to do it in YUI?

Thanks.

+2  A: 

Why do you even need JS for this. Can't you just use CSS for this?

Well anyway check the source for this sample from Edwart Visser

YUI Hover

The JS which is most of interest to you

YUI Hover JS (there is some other code in it for yui module detecion, skip to this comment /* HOVER CODE */)

jitter
Thanks alot, Ill have a look into it.Unfortunately I do need to use JS, I want hover effects on input boxes - fine except in IE6.
jugger000