What steps can be taken to create a unique "peeling" effect on the bottom of a webpage?

I'm attempting to recreate the unique effect seen on this website. On that site, when you scroll down to the bottom of the page, a map appears with a "peeling effect", as if the previous DIVs were sliding above the map. I tried replicating this in a jsfiddle here (using a red div instead of a map) but it's not working correctly. Thanks for any assistance you can provide.

HTML

<div class="block">Block</div>
<div class="block">Block</div>
<div class="block">Block</div>
<div class="block">Block</div>
<div class="block">Block</div>
<div id="map"><div id="map-canvas"></div></div>

CSS:

Html, body {
    min-width: 980px;
    background: #CCC;
    font-family: 'Open Sans', sans-serif;


}
.block {    
    padding: 20px;
    background: green;
    height: 400px;
    width: 600px;
    margin-top: 30px;
    margin-left:50px;
}

#map {
    position: fixed;
    bottom: 0;
    z-index: 1;
}

#map, #map-canvas {
    width: 100%;
    height: 500px;
    float: left;
    background: red;
    position: relative;
    overflow: hidden;
}

Answer №1

To keep the map fixed at the bottom, it is styled with

position:fixed;bottom:0;width:100%
.

The content area is then given a higher z-index than the map to ensure it appears on top.

Lastly, the bottom section of the content includes margin-bottom:500px, allowing for extra scrolling to reveal the map.

Answer №2

Here is the code snippet you can utilize:

VIEW DEMO

HTML Code:

<div id="box">
    <div class="square x"></div>
    <div class="square y"></div>
    <div class="square z"></div>
</div>
<div id="plan">
</div>

CSS Style:

#box{
    margin-top:200px;
    position:relative;
    z-index:3;
}
.square{
    height:200px;
}
.x{background:red;}
.y{background:yellow;}
.z{background:#32658d;}
#plan{
    position:absolute;
    z-index:1;
    height:300px;
    top:0;
    width:100%;
    background:url(http://lorempixel.com/800/500/) center bottom no-repeat;
}

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

Creating a line break in HTML using Bootstrap

Reference the source provided, specifically the red alert option. Here is an example: <div class="alert alert-dismissible alert-danger"> <button type="button" class="close" data-dismiss="alert">&times;</button> <strong> ...

"Discovering the method to access the most recent clicked event data across the entire JavaScript scope

function retrieve_data(){ var information = $(this).data(); // this is undefined console.log(information.crm); } $(document).on('click', '#add_info', (function() { var info = $(this).data(); // this works console.log(info.c ...

Steps to display JSONP response delivered by PHP on a web page

I've written a JSONP script as shown below: <script> $(document).ready(function(){ $("#LoginForm").submit(function(){ var data = $(this).serialize(); //alert(data); $.ajax({ type:"POST", dataType:"jsonp ...

"Exploring the differences between htmlString and document.createTextNode when working with strings in jQuery

When looking at the webpage referenced below http://api.jquery.com/after/ within the section titled "Example: Inserts a DOM element after all paragraphs," there is an example code snippet provided: $( "p" ).after( document.createTextNode( "Hello" ) ); I ...

How can I make a button that functions when clicked using items generated from a database?

@olafmoriarty, I appreciate your help with the initial bit, you were right on point. After experimenting further, I realized that your solution is linked to the Todo ID. However, what I need is for the solution to be based on the Status of a Todo Item. Fo ...

Input element enables simultaneous input and output

Currently, I have a web audio player set up with a basic simulation of how the seekbar functions. The progress bar displays the advancement of the audio track, while an input bar appears on hover to enable user interaction. My issue lies in the fact that ...

Tips for pre-filling tags in ASPTokenInput component

Greetings! I have come across the ASPTokenInput library which can be found at the following URL: https://github.com/harindaka/ASPTokenInput/wiki I am seeking assistance on how to pre populate a token control on page load and on partial postback. Can anyo ...

The bottom textarea in HTML is being pushed too high when the keyboard pops up on an iPhone

I am currently working on a chat application using Javascript. The chatbox is located at the bottom of the body, but every time I visit my HTML page and press the input element, the textarea moves up too high, creating a small gap between the input element ...

jQuery AJAX response presents JSON string parsing issues for Firefox browser

I'm encountering an issue while trying to decode JSON strings in a jQuery AJAX response. Here is the snippet of my code: $.ajax({ type: "POST", url: "Save", data: { expiry: expiry, settings: settings } }).done(function ...

Unusual issue with fixed positioning not functioning

Take a look at this page: When you resize your browser to be greater than 1000px, you'll notice a scrollbar appear. However, the arrows on the page are not fixed in place when you scroll down. I want them to move along with the page and remain fixed ...

Jquery not functioning properly for show and hide feature

I'm new to using Jquery and JqueryUI. I have a div named front, which I want to initially display on window load and then hide it by sliding after a delay of 5500 milliseconds. However, I'm encountering errors in the jquery.min.js file. The HTML ...

Unable to use a button as an event handler in jQuery

As a complete novice, I am on the verge of completing my first website. However, I am facing a roadblock with getting the last button to function properly. It's such a simple task, but for some reason, it just won't cooperate. $( document ).r ...

What is the best way to position a div on the left side when it's large and move it to the

In my coding, there is a particular div element: <div id="UnitInfoDiv" class="form-group row hidden"> <div id=@UnitPartialViewHtmlId class="row"></div> <div class="row"> <div class="col-md-6"> Is ...

One way to retrieve the step value from a slider using jQuery

I need to retrieve the step value of a slider using jQuery. While I can currently locate the step value in the HTML code, I would like to avoid having to update it manually across multiple files if it changes in the future. When I mention the step value, ...

I'm curious why my background generator is only altering a portion of the background instead of the entire thing

I've been attempting to create a JavaScript random background changer, but I'm encountering some challenges. The main issue is that instead of changing the entire page's background, it only alters a strip of it. Additionally, I'm curiou ...

Designing a pair of elements within a single container

I am trying to achieve a layout where Element 1 and Element 2 can grow independently in height. However, I want the container's height to always match that of Element 2, while allowing Element 1 to grow as much as possible without exceeding the height ...

Choosing specific child elements based on their css attribute valuesUnique: "Targeting

I am attempting to customize the appearance of any child divs with the class 'header' that are within parent divs with a class of 'recipes'. I understand that I could simply target .category-recipes .header, but the parent div may vary ...

I am looking to showcase images beside individuals' names or photos on my website in a vertical arrangement, similar to how it is done on Facebook

Looking for suggestions on how to display images uploaded by users on my webpage in a way similar to Facebook, with the user's photo displayed beside each image. Any recommendations or website links would be greatly appreciated. Thanks, Santosh Sahu ...

Displaying Angular 4 HTTP GET response in HTML: A Step-by-Step Guide

I am struggling to retrieve data from a table using the HTTP GET method in Angular 4. How can I display this data on an HTML page? getData(){ //return this.data; return this.http.get("http://localhost:8080/SpringRestExample/get/filedata") ...

Creating an HTML Table on the Fly

Is there a way to dynamically generate multiple HTML tables or ASP tables? I attempted the following code but it didn't work as expected. Table tb = new Table(); tb.ID = "tbl" + TBname; TableRow rowNew = new TableRow(); tb.Controls.Add(rowNew); for ( ...