Incorporating full-screen viewing in the browser, these websites provide a seamless user experience with a "learn more" button strategically placed at the bottom. This button effortlessly

Have you ever noticed how websites like Heroku.com and dropbox.com automatically display a full-screen homepage tailored to your browser size? They have a clever button at the bottom that smoothly scrolls you down the page for more information. Have you wondered how they achieve this effect? If so, can someone assist me with setting up a simple code to replicate it?

I've created a basic outline over here http://jsfiddle.net/WwHP6/, but I'm struggling to implement the full-screen functionality and the 'learn more' link.

HTML

<div class="page1">
    <nav class="navigation">
        <ul>
            <li>Home</li>
            <li>Support</li>
            <li>Sign Up</li>
            <li>Contact</li>
        </ul>
    </nav>
</div>

<div class="page1-content centered">
        <h1> Generic Header</h1>
        <h2> Generic Content 1</h2>
        <h2> Generic Content 2</h2>
        <h2> Generic Content 3</h2>    
</div>    

<div class="learn-more centered">
    <a href="#learn"> learn more </a>
</div>


<div class="page2-content">
    <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tel...
</p>
</div>

CSS

body {
    background: blue;
    color: white;
}

.centered {
    margin: 0px auto;
    position: relative;
    vertical-align: middle;
    text-align: center; 
}
nav {
  list-style: none;

}

.navigation ul li { 
    list-style: none;
    float:left;
    margin: 5px;
}

.page1-content {
    clear:both;
}

.learn-more a {
    color:red;
}

.page2-content {
    margin: 200px 0 auto;
    background-color: white;
    color: black;
    background-size: 100% 1000px;
}

Answer №1

Take a look at jQuery.ScrollTo, it seems like it may be just what you need.

I've also put together a Demo Fiddle to show you how to implement this. Hopefully, it will be useful for you.

Below is the script:

$(document).ready(function (){
            $("#click").click(function (){
                //$(this).animate(function(){
                    $('html, body').animate({
                        scrollTop: $("#text").offset().top
                    }, 2000);
                //});
            });
        });

Answer №2

Not entirely sure what you're looking for, but hopefully this information will be helpful:

http://jsfiddle.net/WwHP6/1/

To summarize: Wrap a div around your "page1"-Div and make it the size of the screen.

CSS

body, html{
    width:100%;
    height:100%;
    padding:0px;
    margin:0px;
}

.page1_wrapper {
    height:100%;
    width:100%;
    overflow:hidden;
    border:1px solid red; /* just needed to show the size of the div */
}

Scrolling can be achieved with simple anchor tags. However, clicking on them will jump to the anchor without playing an animation or transition. To incorporate this, JavaScript would be required. For instance, JQuery offers scrollTo() function.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Mobile FPS suffering due to slide-out drawer performance issues

My application features a drawer menu that functions smoothly on desktop, but experiences issues on mobile devices with noticeable lag. Within the header, I have implemented a boolean value that toggles between true and false upon clicking the hamburger i ...

Using JQuery to reverse the action of hiding an image

Having some trouble with my Javascript and JQuery skills, so bear with me. I've set up a gallery of images where users can drag and drop them into a designated drop zone. Everything works fine when dragging an image from the gallery to the drop zone a ...

How can SQL data be loaded following the selection from a dropdown menu?

I have a pressing query that I need assistance with. I am aiming to achieve a certain task, but due to lack of prior experience in this area, I am unsure about how to proceed. My current situation involves populating a dropdown menu with names retrieved f ...

Exploring cross-domain loading and AJAX with JQuery

My process for loading items on is as follows: Starting with JQuery via Google API Next, I load two global functions from another domain: loadcrossdomain (using getJSON via query.yahooapis) and a simple function for URL parsing Inclusion of Googl ...

Executing Java method via JavaScript by simply clicking a button

I am currently facing a challenge in finding a way to invoke a Java method from JavaScript and pass user input variables into the method call. The main issue I have encountered is that JavaScript seems to interpret/resolve the Java method during page load. ...

Responsive navigation menu featuring dynamic dropdown menus using HTML and CSS

Looking to design a responsive HTML and CSS navigation menu with multiple dropdown menus? You're in the right place. I've scoured countless YouTube videos, but haven't quite found the perfect template for a two-part navigation menu that tic ...

Unexpected lag causing delays in jQuery animations

I am attempting to implement a "hover" effect using jQuery. Everything seems to be working fine, except for a strange delay that occurs only the first time the complete callback is triggered - oddly enough, this is the only instance where it reaches the pr ...

How to retrieve XML data using jQuery AJAX

I am facing an issue with returning an xml file from the server to the client and parsing it using jQuery's ajax function. The code snippet is as follows: Client: $("#submit").click(function(){ $.ajax({ type: "POST", ...

Utilizing BeautifulSoup to Extract Links

Currently, I am extracting cricket schedules from a specific website using Python's Beatiful Soup library. The webpage I am scraping corresponds to the following URL: www.ecb.c0.uk/stats/fixtures-results?m=1&y=2016 This particular link displays ...

Clearing the iframe content from the previous tab whenever a new tab is chosen

My webpage features a tabbed container with iframes embedded in each tab. The challenge I face is that the content within these iframes is extensive, leading to performance issues when switching between tabs. To address this issue, I am seeking a solution ...

Troubleshooting Bootstrap image alignment problem with columns on extra small screens

My website showcases screenshots of my software in a div element. Everything looks great on larger screens, but once I switch to a phone or resize the window, the images don't align properly, leaving empty space. Refer to the image below for clarifica ...

What could be causing this issue with the jQuery CSS not functioning properly?

When I come across the following HTML snippet: <div id="map"> <div class="elem"> hey1 </div> <div class="elem"> hey2 </div> <div class="elem"> hey3 </div> </div> In JavaScript: va ...

Identify which anchor tag from the group with the matching class was selected and retrieve its unique identifier

There are multiple anchor tags with the same class in my code. <a href='' id='id1' class='abc'>Link 1</a> <a href='' id='id2' class='abc'>Link 2</a> <a href='&apos ...

Integrating blade code within blade code

Struggling to craft a button using the Form builder. {!! Form::button('<span style="color: {!! $colour[$i] !!}" class..') !!} The specific details of the button don't matter, all I wanted was to adjust the font color to $colour[$id]. Th ...

Errors in formatting and positioning present in jQuery UI Droppable functionality

I'm experiencing issues with a seemingly simple jQuery-UI droppable/sortable list. The source list contains draggable LI elements, and the destination list uses the last child as the drop target. There are two main problems: 1) Despite using insertB ...

Storing the order of jQuery UI Sortable in the WordPress Admin Panel

My goal is to customize the order of taxonomy terms for each individual post in Wordpress. I have created a metabox on the EDIT POST page that contains custom taxonomy terms and made them sortable using JQuery. Here is my setup on the Wordpress backend: ...

Why does Internet Explorer display .png images in lower quality compared to other browsers?

My menu displays a .png file with smooth edges in most browsers, but in Internet Explorer it appears with rough edges. Can someone help me understand why IE treats .png files differently compared to other browsers? <li> <a href="" onclick=" ...

Navigating through each element of an array individually by using the onClick function in React

I'm currently working on a project that involves creating a button to cycle through different themes when pressed. The goal is for the button to display each theme in sequence and loop back to the beginning after reaching the last one. I've imple ...

Transform your table into an ASCII-art masterpiece using CSS styling techniques

My vision is to style a table "ASCII art" using CSS, like the example below: +------+---------+----+ | Jill | Smith | 50 | +------+---------+----+ | Eve | Jackson | 94 | +------+---------+----+ | John | Doe | 80 | +------+---------+----+ <ta ...

Can cookies operate on a local server?

Similar Question: Cookies on localhost with explicit domain Here is the code snippet that I am using after the user has logged in: setcookie("user",$entered_username, time()+(60*60*5)); setcookie("password",$entered_password, time()+(60*60*5)); ...