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
精彩评论