How to make "Scroll further down" button on website? - javascript

I am using wordpress' revolution slider that spans the home page. I want to put a scroll down button, so users are aware they can scroll. I want something like this one: https://exposure.so/
I tried putting a div on top of everything and a link that links to anchor link further down the page. It works, but I don't know how to make the div disappear when the user goes down, and reappear if they go back up. Anyone know how to fix this?

You need to calculate the scrollbar's handle position using javascript or jQuery.
If its towards the bottom of the page, hide the button, else show it.
To find scrollbar position : LINK

Related

how do I add a javascript scroll effect?

I'd like to add a scroll effect whereby instead of jumping instantly to the anchor down the page, when you click a link at the top it rolls smoothly down the page. Haven't had any luck yet. It's common in bootstrap websites:
bootsrap template
You can use this for example:
https://www.solodev.com/blog/web-design/adding-an-animated-scroll-down-anchor.stml
Basically, you want to play with the scroll (controller via javascript) to me smoothly to the final position (anchor position). There are many ways you can achieve that.
There's also this post here about it:
Smooth scrolling when clicking an anchor link

Panel with start button that moves up on button click

I want a panel with a start button in the middle of the page. When the button is clicked the panel should move up and disappear. The content of the page should start loading after the button is pressed. Something like a start button for a game.
Currently I use two html pages. The first is the panel(index.html) and the second is the content. When I press the button it moves the panel up, removes it and loads the second page. It feel a bit clunky so I wonder is there a better way to do this?
I'm not sure if this works for canvas. As I said in the comments I suggest doing a text-align:center;. This works for text and buttons. To center other elements such as divs try margin: auto;. Good luck with canvas :-)
I would also suggest expanding your css knowledge because text-align is very common to use as well as margin:auto;.

How to stop image from moving downward when scrolling?

I have created a header image of about half a page. When user scroll down the images goes down with scrolling as well. I want the image to go up and hide and does not effect the content beneath it. I have checked many single page websites websites where images are on some place and when scrolling they goes up and down with scrolling and does not effect the other things.
I tried to use position:fixed but it didn't work, position:relative is also effecting the content beneath it.
Example of what i want : http://www.piedpiper.com/
Kindly tell me how to do this.
Set position:fixed for parent element of image.

Object fixed below certain point

This is my first post here, before this I have had tremendous help from this forum and all the users previous posts. The question I have now I cannot find the answer to. So:
I have an object (button) which when pressed smoothscrolls the user up to top of the page. Im successful in making it fixed to the top of the screen, however, lets say youre at the bottom of the page and you press the "smoothscroll button", its starts scrolling you upwards to the top. But when your "near" the top I want the button to stop and the scrolling to continue...
Im not sure how to describe it better, but if you go from the top of the page, or when at the top of the page, you dont see the button and when you start scrolling down, youll see the button as any object on the screen "climbing upwards" and when the button reaches the top of the screen it stays there fixed.
Im sure this is common on ads for example..
How would you achieve this? Any help appreciated..
Thx,
Layman
It seems like this is what you want to achieve.
http://stickyjs.com/
if you are still not impressed.. here is a link to the treasure of plugins that would do what you need with very little code.
http://jquery-plugins.net/tag/sticky-scroll
One of my coworkers wrote a plugin that hides a button as the page is being scrolled to the top. You may be able to use similar logic. It would be something like this:
btt.revealPosition = 300;
$(window).scroll(function(){
if($(window).scrollTop() >= btt.revealPosition){
//Add a class here that lets the button scroll with the page
}else{
//Add a class here that fixes the button to the top of the page
}
});
It basically watches the scroll position as you're scrolling back to the top of the page. Upon reaching the revealPosition of the button, you could add a class or modify the css with jquery to change how the button is acting.
This logic was taken from the following plugin:
jquery-backtotop

Javascript scrolling menu that starts only after a certain ways down the page

I want a scrolling menu that begins at a certain part of the page (like under the header), but stays there till you scroll down and it hits the top of your browser window, then follows you down the rest of the page.
Anyone have any clue how to do this? I can't find it anywhere on the net. I've seen others similar to it, but none that move to the top of the window.
There's a great example on gmail when you are viewing an email. The toolbar stays at the top of the email box, but once you scroll past the email box, it follows you down the page.
I know that position:absolute;top:0; will make it stay at the top without the fluid motion (I hate it because it looks sloppy).
** edit **
I really only need to know how to detect that the menu div is at the top of your page. I can do a mock thing where if you scroll down how ever far the menu div is, it will start scrolling down, but I'd rather actually get whether the menu div is past the browser window or not.
It's a mixed position of fixed and absolute, you will handle.scroll event and switch between that.
You can find an example here
Creating a floating box which stays within a div

Categories