开发者

jQuery like image swap in YUI

开发者 https://www.devze.com 2022-12-09 12:45 出处:网络
Im trying to replicate a simple hover effect in YUI just like you would with jQuery however its a little confus开发者_StackOverflow社区ing.

Im trying to replicate a simple hover effect in YUI just like you would with jQuery however its a little confus开发者_StackOverflow社区ing. 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.


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 */)

0

精彩评论

暂无评论...
验证码 换一张
取 消