最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - where to put jquery codes in blogger - Stack Overflow

programmeradmin1浏览0评论

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
Add a ment  | 

1 Answer 1

Reset to default 4

First 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>
发布评论

评论列表(0)

  1. 暂无评论