开发者

jquery change id on hover

$('#klik').hover(function() {
    $('#font1').animate({"color":"#efbe5c","font-size":"52pt"}, 'fast');开发者_StackOverflow中文版
}, function() {
    $('#font1').animate({"color":"#e8a010","font-size":"48pt"}, 'fast');
});

how can i change the code, so instead of the values there #font1 will change to #font2 ?


You can do it

$('#font1').attr("id",newId);

Let me know if that solved your issue!


Here is an example of using css to change the color and the font size. You will lose the transition effects that the animate gives you...I don't know if that is important.

http://jsbin.com/urido4/3/edit

Bob

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜