Trouble arises when dealing with components beyond just the background while using jquery_interactive_bg.js

After experimenting with different plugins, I managed to achieve a parallax effect on my website's landing page by using the interactive_bg.js plugin. Following the steps outlined in a demo tutorial, I was able to attain the desired visual effect.

Below is the current structure of my HTML -

<body>
  <div class="wrapper bg" data-ibg-bg="pics/Q.jpg">
      <div class="main">
          <h1>I am<span id="typed"></span></h1>
          <h4 id="test">I create<span id="typed2"></span></h4>
          <a id="but1" class="ghost-button-semi-transparent" href="#">Check me out!</a>
    </div>
  </div>  
</body>

Check out the relevant CSS -

  html {
    height: 100%;
  }
  body {
    padding: 0;
    text-align: center;
    font-family: 'Roboto Condensed', sans-serif;
    position: relative;
    margin: 0;
    height: 100%;
  }
  .wrapper {
    height: auto !important;
    height: 100%;
    margin: 0 auto;
    overflow: hidden;
  }
  .main {
    float: left;
    width: 100%;
    margin: 0 auto;
  }
  .bg {
    position: absolute;
    min-height: 100% !important;
    width: 100%;
    z-index: 0;
  }

  .ibg-bg {
    position: absolute;
  }
  .main {
    position: relative;
  }

At this point, any elements placed after the wrapper bg div either stack below it or require absolute positioning to appear on top. Adjusting margins can lead to layout issues when the window size changes.

How can I effectively position elements following the wrapper bg div?

Answer №1

Based on my understanding of your query, you are looking to insert content after a div with the class wrapper bg. This particular div currently has a position of absolute. By changing its position to relative, the div will stay at the top of the page with a height of 100%. Subsequently, any new div added will position itself after the wrapper div, meeting your desired outcome.

Answer №2

Modify the CSS from absolute positioning to relative positioning

Delete the body height set to 100%

Adjust the height of the .wrapper as required

.bg {
  position: relative;
  min-height: 100% !important;
  width: 100%;
  z-index: 0;
}
body {
  padding: 0;
  text-align: center;
  font-family: 'open sans';
  position: relative;
  margin: 0;
}
.wrapper {
    height: auto !important;
    height: 300px;
    margin: 0 auto; 
    overflow: hidden;
}

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

Issue encountered with AngularJS .run not executing

It seems like the module is not functioning properly. In my index.js file, I have the following code: // index.js ---type 1 // .run not working... var myServiceToRun = require('./myservice.js'); var mod = angular.module('myApp',[]); mo ...

Guide on populating a series of rectangles in a line based on values stored in an array using d3.js

I have 100 rectangles arranged in a 10x10 square. My goal is to assign colors to the rectangles based on values from an array var avg = [1, 4, 4, 7, 11, 15, 58] I'm facing an issue at the value 4 being repeated and I find the current code quite mess ...

Is there a way in Material UI to dynamically update the border color of a TextField once the user inputs text?

Is there a way to style the border of a TextField only when it has text input? I am currently using the outlined version of the TextField, which displays placeholder text when empty. <TextField variant="outlined" /> So far, I have managed ...

Unable to assign an ID value to a <span> element within a <th v-for="" > tag

I am attempting to assign the ID value of the span tag within a for loop using v-for. <table class="APPPPTable" style="width:100%;font-size:11px;"> <thead> <tr> <th v-for="heading in tableInfo.columns" class="text-c ...

Turning off v-navigation-drawer for certain routes in Vue.js

I currently have a v-navigation-drawer implemented in my webpage using the code below in the App.vue file. However, I am looking to disable it on certain routes, such as the landing page: <v-app> <v-navigation-drawer id ="nav" persistent : ...

What is the best way to position an image in the center of the screen with uniform margins around it?

Could someone please help me figure this out? I've been attempting for some time but can't seem to make it work with the bottom margin. This website in the fashion industry showcases what I'm trying to achieve: It's designed to be resp ...

How to Implement Dotted Line Styling for Row Data in ReactJS with CSS?

I'm working on a condensed design with Reactjs Monday......................08:00 AM - 21:00 PM I have a lot of dots in the display above. How can I make it shorter without using so many dots? Entering numerous dots like this is not ideal for the webs ...

Resposiveness of force-directed graph is lost

const container = document.getElementById("container"); const svgElement = d3.select(container).append("svg") // Get the width and height computed by CSS. let width = container.clientWidth; let height = container.clientHeight; const colorScale = d3.scale ...

Utilize a singular object to contain multiple instances of the useState hook

const [regionData, setRegionData] = useState({ country: "", city: "", population: "", location: "", temp_min: "" }); Does anyone know a more efficient and cleaner way to replace these individual useState hooks by organizing them into ...

What is the appropriate content-type to use when sending AJAX POST data?

Having an issue sending base64 image data using ajax post. I suspect the problem lies with the Content-Type value, as I have tried using application/json, text/json, and image/jpeg without success. Javascript function sendFormData(fD) { var urls = fD ...

Use JavaScript to find any text enclosed within [quote] and [/quote] tags and then replace it with <div class="quote-text">foo text</div>

Hey there! I have a specific text format that looks like this: [quote]foo text[/quote] and I would like to convert it to the following: <div class="quote-text">foo text</div> Do you have any idea how I can achieve this using JavaScript? Cu ...

I'm having trouble locating the container with only one child element in JavaScript

I am currently working on a project where I need to locate a specific container using JavaScript. More specifically, I am looking to target the container that houses the required address. My aim is to assign a class to the container of the requested addre ...

unable to use split method in node js during put operation

I am currently working on an update action within my Node.js project. When new data is inputted, I am experiencing a peculiar issue. When I input fresh data, the split method functions properly. However, if I input the same data again, the split method fa ...

Encountering an issue trying to insert multiple objects into a Laravel session

Whenever I attempt to add an item to the cart, it only adds it once. If I try to do it again, it ends up overwriting the existing item and the counter for the items in the cart remains at 1. I've experimented with switching between a button and a lin ...

I'm having trouble locating my route for some unknown reason

I've set up a basic code structure to test my routes, but I keep getting a 404 error. Although I have an app.all function to catch errors, I'm having trouble pinpointing where the issue lies. Below is my index.js file, where I've configured ...

Switching Angular fxLayout from row to column based on a conditional statementHere is an explanation of how to

Visit this link for more information Is there a way to set direction based on a specific value? <div if(value) fxLayout='row' else fxLayout='column'> ...

Sending Twilio SMS Data from Node to React can be achieved by passing the post data

Currently utilizing Twilio for receiving SMS messages on my server, I am seeking a way to display the returned data in React. As Twilio sends data only server-side via a POST request when a text is sent from my phone, how can I access this POST data in m ...

Leverage the input value from a text field within the same HTML document

Is it possible to utilize the input text value assigned to name='t0' within the same HTML document? Here's the code snippet you can refer to - <!DOCTYPE html> <head> <link rel="stylesheet" href="https://sta ...

Encountering an issue with Google distance matrix where property 'text' is undefined

Below is a snippet of code that calculates the distance between two user-provided addresses. This code currently runs when the user submits a form in this manner: $("#distance_form").submit(function (e) { e.preventDefault(); calculateDistance(); }); ...

A guide on verifying if two arrays of integers are permutations using JavaScript

Is there a way to determine if two sets of integers in JavaScript are permutations? For example, given the arrays: a = [1, 2, 3, 4, 5] and b = [2, 3, 5, 1, 4] I want a function that will return true if they are permutations of each other. ...