gpt4 book ai didi

javascript - jQuery .fadeIn(和所有 jQuery)不工作

转载 作者:行者123 更新时间:2023-12-03 08:52:51 24 4
gpt4 key购买 nike

我知道还有很多关于此的其他主题,但没有一个对我有用。我有一个 div,我想用 jquery 淡入淡出。 (我最初希望它在用户向下滚动时淡入,但这也不起作用,但如果有人也能帮助我,那就太好了!)

这是我的代码:

<script src="https://code.jquery.com/jquery-1.10.2.js">
</script>
<script>
$(function() {
$(".twitter-widget").fadeIn(5000);
});
</script>
<style>
#twitter-widget {
position: fixed;
bottom: 15px;
right: 30px;
}
</style>
<div style="text-align: center;" id="twitter-widget">
<div style="Background-color: white; Width: 200px; Height: 100px;" class="content">
<style>
.rhett-link, .chadtronic, .here-now, .htde {
border-radius: 10px;
}`
</style>
<a href="https://twitter.com/averybmiller" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @averybmiller</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<br>
Followed By
<br>
<a href="http://www.twitter.com/rhettandlink">
<img src="https://pbs.twimg.com/profile_images/1617483791/RhettAndLink_Logo_RGB.jpg" height="40px" width="40px" alt="Rhett and Link" class="rhett-link"></a>
<a href="http://www.twitter.com/chadtronic">
<img src="https://pbs.twimg.com/profile_images/642137361124454400/p4Aui6FS.png" height="40px" width="40px" alt="Chadtronic" class="chadtronic"></a>
<a href="http://www.twitter.com/hereandnow">
<img src="https://pbs.twimg.com/profile_images/378800000068124541/9fdeea271f46802d828b3b5a194df006.png" height="40px" width="40px" alt="NPR's Here and Now" class="here-now"></a>
<a href="http://www.twitter.com/htde">
<img src="https://pbs.twimg.com/profile_images/431891488675332096/DDbr4grY.png" height="40px" width="40px" alt="NPR's How to do Everything" class="htde"></a>
<br>
</div>
<div style="background-color: #FF5500; Width: 200px; Height: 2px"></div>
</div>

现在 fadeIn. 或任何与此相关的 jquery 东西都不起作用。我想不通。有任何想法吗?

最佳答案

<style>必须写在head标签内<head></head> ,还有你的<style> html 中的标签有两次不正确

你的twitter-widget是id而不是class,更改$(".twitter-widget").fadeIn(5000);$("#twitter-widget").fadeIn(5000);

$("#twitter-widget").fadeOut(3000).fadeIn(3000);
  #twitter-widget {
position: fixed;
bottom: 15px;
right: 30px;

}
.rhett-link, .chadtronic, .here-now, .htde {
border-radius: 10px;
}`
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<div style="text-align:center;" id="twitter-widget">
<div style="Background-color: white; Width: 200px; Height: 100px;" class="content">
<a href="https://twitter.com/averybmiller" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @averybmiller</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<br>
Followed By
<br>
<a href="http://www.twitter.com/rhettandlink">
<img src="https://pbs.twimg.com/profile_images/1617483791/RhettAndLink_Logo_RGB.jpg" height="40px" width="40px" alt="Rhett and Link" class="rhett-link"></a>
<a href="http://www.twitter.com/chadtronic">
<img src="https://pbs.twimg.com/profile_images/642137361124454400/p4Aui6FS.png" height="40px" width="40px" alt="Chadtronic" class="chadtronic"></a>
<a href="http://www.twitter.com/hereandnow">
<img src="https://pbs.twimg.com/profile_images/378800000068124541/9fdeea271f46802d828b3b5a194df006.png" height="40px" width="40px" alt="NPR's Here and Now" class="here-now"></a>
<a href="http://www.twitter.com/htde">
<img src="https://pbs.twimg.com/profile_images/431891488675332096/DDbr4grY.png" height="40px" width="40px" alt="NPR's How to do Everything" class="htde"></a>
<br>
</div>
<div style="background-color: #FF5500; Width: 200px; Height: 2px"></div>
</div>

关于javascript - jQuery .fadeIn(和所有 jQuery)不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32620950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com