admin管理员组文章数量:1335877
I have a webpage. I want to change the icon on button down (this would be enough for me to understand but I'd be glad if you'd describe a way to animate icon after button click).
I have a webpage. I want to change the icon on button down (this would be enough for me to understand but I'd be glad if you'd describe a way to animate icon after button click).
Share Improve this question edited Oct 12, 2010 at 20:55 jball 25k9 gold badges72 silver badges92 bronze badges asked Oct 12, 2010 at 20:49 RellaRella 67k112 gold badges374 silver badges642 bronze badges 1- Do you want to change the favicon, or something else? More detail, please. – Matt Ball Commented Oct 12, 2010 at 20:51
2 Answers
Reset to default 7If you do want to change the favicon, jball's solution will not work, because browsers don't seem to notice when an existing <link>
changes. You need to remove the existing tag and insert a new one:
$(document).ready(function(){
$('#favicon').remove();
$('head').append('<link href="http://example./favicon.ico" id="favicon" rel="shortcut icon">');
});
NB This supposes that your original favicon link has the id favicon
.
http://api.jquery./click/
check this for click event . In that demo , remove class is using. addClass function is there.
You can change image using css itself if you want.
show() hide(); functions are there to show hide divs . you can use these too
本文标签: javascriptChanging HTML page IconStack Overflow
版权声明:本文标题:javascript - Changing HTML page Icon? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742394861a2466717.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论