how can I make my image (down arrow) disappear when I start scrolling my page?

randomuser1

I have the following page http://jsfiddle.net/Leytgm3L/20/ and there's this white square that in the future will be the link to the area below - how can I make so when user starts scrolling down then this icon will disappear? so far the css for this arrow looks like this:

.next-section {
    width:60px;
    height:60px;
    background-color:white;
    background-image:url(../img/next_section.png); 
    background-size: 34px 18px; 
    background-repeat:no-repeat; 
    background-position:13px 21px;
    position:absolute;
    bottom:0px;
    left:50%;
    margin-left:-30px;
    opacity:0.9;
}

I'm just not sure if I can do it only in CSS or should I use some jquery here (also - I don't know how to do it here)... Thanks

DFayet

Just a bit of jQuery

$(window).scroll(function() {
    if ($(this).scrollTop() > 0) {// can be whatever, 0 refers to the top space you allow
        $('.move').hide();// Hide your element
    }
    else {
        $('.move').show();// It's just if you want to show back the element if we're back on top
    }
});

Take note that I, according to your fiddle masked the link (.move) and not just the inner div.

Hope it's gonna help you


If you want to show back, take a note to the comment of Juan C and use his code:

$(window).scroll(function(){
    $(".move").toggle($(this).scrollTop() === 0);
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I make a image to scroll down or up when I scroll down or up page?

From Dev

How Can I make my header disappear and reappear by clicking a button and also have the button change my page background

From Dev

How Can I make my header disappear and reappear by clicking a button and also have the button change my page background

From Dev

HTML -- How can I make my navbar stick after scrolling to a certain point on page?

From Dev

How can I get my drop navigation to not bug out when page is scrolling?

From Dev

How can I make my drop down menu scrollable

From Dev

How can I make text in my td wrap when it reaches the width of the image in my td?

From Dev

Whay do my divs move down on the page when there they have text in them and how can I fix this?

From Dev

ls -a lists files with "->" arrow I think they are linked how can I make my new file to change when referenced file is changed?

From Dev

How can I make my webpage responsive when I minimize the page

From Java

How do I make my images disappear when clicked using the code I have?

From Dev

How do I make my arrow accordion display a downward pointing arrow when pressed?

From Dev

Can I make my Panel the only active page when selected

From Dev

How can I start the Accessibility Settings Page of my APP in Android?

From Dev

How can I make all my processes start with niceness 5

From Dev

How can i make my app when running it to start clean on every launch?

From Java

How can I start an image animation from the beginning when it appears in my slider?

From Dev

How can I do the slide down effect to not bring my web page back to top when I press the button that actions the effect?

From Dev

How can I do the slide down effect to not bring my web page back to top when I press the button that actions the effect?

From Dev

How can I make my background-color fill all my content, even with horizontal scrolling?

From Dev

How can I make my background-color fill all my content, even with horizontal scrolling?

From Dev

I'm resizing an image while scrolling in my website, but i cant figure how to make an animation for the resizing

From Dev

How can I make my function to run the moment the page is running?

From Dev

How can I make my page.open() requests sequentially?

From Dev

How i can make an iframe to fit in my page?

From Dev

How can I make my html page search engine friendly

From Dev

How can I speed up the rendering of an image on my page?

From Dev

How can I speed up the rendering of an image on my page?

From Dev

How can I set the default image used when my page is shared on Facebook?

Related Related

  1. 1

    How can I make a image to scroll down or up when I scroll down or up page?

  2. 2

    How Can I make my header disappear and reappear by clicking a button and also have the button change my page background

  3. 3

    How Can I make my header disappear and reappear by clicking a button and also have the button change my page background

  4. 4

    HTML -- How can I make my navbar stick after scrolling to a certain point on page?

  5. 5

    How can I get my drop navigation to not bug out when page is scrolling?

  6. 6

    How can I make my drop down menu scrollable

  7. 7

    How can I make text in my td wrap when it reaches the width of the image in my td?

  8. 8

    Whay do my divs move down on the page when there they have text in them and how can I fix this?

  9. 9

    ls -a lists files with "->" arrow I think they are linked how can I make my new file to change when referenced file is changed?

  10. 10

    How can I make my webpage responsive when I minimize the page

  11. 11

    How do I make my images disappear when clicked using the code I have?

  12. 12

    How do I make my arrow accordion display a downward pointing arrow when pressed?

  13. 13

    Can I make my Panel the only active page when selected

  14. 14

    How can I start the Accessibility Settings Page of my APP in Android?

  15. 15

    How can I make all my processes start with niceness 5

  16. 16

    How can i make my app when running it to start clean on every launch?

  17. 17

    How can I start an image animation from the beginning when it appears in my slider?

  18. 18

    How can I do the slide down effect to not bring my web page back to top when I press the button that actions the effect?

  19. 19

    How can I do the slide down effect to not bring my web page back to top when I press the button that actions the effect?

  20. 20

    How can I make my background-color fill all my content, even with horizontal scrolling?

  21. 21

    How can I make my background-color fill all my content, even with horizontal scrolling?

  22. 22

    I'm resizing an image while scrolling in my website, but i cant figure how to make an animation for the resizing

  23. 23

    How can I make my function to run the moment the page is running?

  24. 24

    How can I make my page.open() requests sequentially?

  25. 25

    How i can make an iframe to fit in my page?

  26. 26

    How can I make my html page search engine friendly

  27. 27

    How can I speed up the rendering of an image on my page?

  28. 28

    How can I speed up the rendering of an image on my page?

  29. 29

    How can I set the default image used when my page is shared on Facebook?

HotTag

Archive