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>