admin管理员组文章数量:1414621
i got the correct codes which could solved my problem, in previously posted questions : How do I get an image to fade in and out on a scroll using jQuery?
var divs = $('.banner');
$(window).scroll(function(){
if($(window).scrollTop()<10){
divs.stop(true, true).fadeIn(5000);
} else {
divs.stop(true, true).fadeOut(5000);}
});
now I can't understand how to implement this code in blogger.
i got the correct codes which could solved my problem, in previously posted questions : How do I get an image to fade in and out on a scroll using jQuery?
var divs = $('.banner');
$(window).scroll(function(){
if($(window).scrollTop()<10){
divs.stop(true, true).fadeIn(5000);
} else {
divs.stop(true, true).fadeOut(5000);}
});
now I can't understand how to implement this code in blogger.
Share Improve this question edited May 23, 2017 at 10:34 CommunityBot 11 silver badge asked Nov 16, 2013 at 16:36 Abhishek SenAbhishek Sen 3584 silver badges10 bronze badges 3- 2 First: What's your problem? Second: Where's the question? – cr0 Commented Nov 16, 2013 at 16:38
- i want to make a div hidden, when scrolled upto a certain point say 500px from top, after crossing that point it could bee visible again. – Abhishek Sen Commented Nov 17, 2013 at 7:54
- this is link, where i found the answer stackoverflow./questions/17928132/… – Abhishek Sen Commented Nov 17, 2013 at 7:58
1 Answer
Reset to default 4First include the jQuery in your <head>
if you don't have it (this is pulsory, else you won't be able to use any jQuery code).
<script src='http://ajax.googleapis./ajax/libs/jqueryui/1.8.23/jquery-ui.min.js' type='text/javascript'></script>
Then paste this code in your <body>
between the <script>
tag
<script type="text/javascript">
var divs = $('.banner');
$(window).scroll(function(){
if($(window).scrollTop()<10){
divs.stop(true, true).fadeIn(5000);
} else {
divs.stop(true, true).fadeOut(5000);}
});
</script>
本文标签: javascriptwhere to put jquery codes in bloggerStack Overflow
版权声明:本文标题:javascript - where to put jquery codes in blogger - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745155324a2645135.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论