The scrolling navigation bar appears behind the slider, causing the parallax effect on the slider to not work properly

While I was scrolling down, my menubar went behind the cycle slider. I tried using z-index 1, but it's not working. Can anyone provide a solution? I'm not sure what I did wrong.

    </div>
<img src="http://malsup.github.io/images/p1.jpg">
    <img src="http://malsup.github.io/images/p2.jpg">
    <img src="http://malsup.github.io/images/p3.jpg">
    <img src="http://malsup.github.io/images/p4.jpg">
</div>
</div>
<div class="section_about">

</div>

*{
    margin: 0;
    padding: 0;
}

/* Top Menu Start Here */

.top_nav{
    height: 90px;
    width: 100%;
    background: rgba(0,0,0,.5);
    position: fixed;
    z-index: 1;
    transition:all 0.7s ease;
    -webkit-transition:all 0.7s ease;
    -moz-transition:all 0.7s ease;
    -o-transition:all 0.7s ease;
    -ms-transition:all 0.7s ease;
}

.container{
    height: 100vh;
    width: 100%;
    max-width: 100%;
    background-image: url("https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQ24kd_2tEzjbb_GdPnMQKog7lMCxtYmmy7dxjjpDr6d2ZseK-Dig");
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    top: 0;
}

.site-dt{
    background-color: #fff;
    height: 573px;
    width: 100%;
}


#slider-main{
    height: 578px;
    width: 100%;
    overflow: hidden;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#slider-main #slider img{
    height: 100%;
    width: 100%;
}

.section_about{
    height: 573px;
    width: 100%;
    background-color: #de5670;
    overflow: hidden;
    position: absolute;
}

Answer №1

Have you tried implementing:

 display: block;

and/or

 display: table;

on both elements? Assign the index 2 to the menu and index 0 to the slide container. Hopefully, this solution will work for you.

Answer №2

Here is a suggested solution:

#slider-main #slider img{
      height: 100%;
      width: 100%;
      position:absolute !important;
      z-index:2!important;
}

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

The page only appears properly after clearing the cache

My floating list menu is behaving oddly in Firefox. It only displays correctly after clearing the cache, but as soon as I refresh the page, the menu breaks again. The links inside the list elements appear wider than the text, even though I haven't se ...

Creating a HTML5 canvas animation of an emoticon winking to add a fun touch to your

Currently, I am facing a challenge in animating an emoticon that was initially sketched on canvas. While following a tutorial to implement draw and clear animations using frames, I haven't been able to achieve the desired outcome. With 6 frames of the ...

Rails Ajax form submission not working

I recently set up a basic Google form on my website and used this website to extract the HTML code for display. However, upon hitting submit, nothing happens - the page seems to be frozen. I'm attempting to redirect the form submission to another page ...

Node responds with a 404 error upon receiving the post request

I am facing an issue with my jQuery code. Here is what I have: $.ajax( { type: 'POST', data : mydata, url : '/routerfunction', dataType : 'String', success : function(data) ...

Aligning a navigation bar with a hamburger menu in the center

I recently implemented a hamburger menu with some cool animations into my site for mobile devices. Now, I am facing the challenge of centering the menu on desktop screens and it's proving to be tricky. The positioning is off, and traditional methods l ...

Tips on retrieving the ID value

My goal is to access the value of the 'id' property in a component. Below is my attempt: constructor(props) { super(props); this.state = { ...

Passing a null value from jQuery Ajax to servlets

Currently, I am working on a sample application utilizing jQuery ajax. In my Login.jsp file, the code snippet looks something like this: <html> <script> $(document).ready(function() { $("#dialog").dialog(); $("#Login ...

Retrieving a date and time value from an object based on a specific range

Having trouble displaying all the user IDs and creation dates within a specific date range in a table. I'm struggling with filtering the data based on dates. Can someone help me identify what I might be doing wrong? I've attempted to replicate th ...

The JSON parsing functionality is not working as expected in my app.js file

app.js: const express = require("express"); const https = require("https"); const app = express(); const port = 3000; app.get("/",function(req,res){ const url ="https://maps.googleapis.com/maps/api/geocode/jsonaddress=1600+Amphitheatre+Parkway,+Mounta ...

Trouble with second function invocation in JavaScript

After creating two sets of arrays and passing them into different functions, I noticed some strange behavior. The first time I called the functions for scores1, everything worked perfectly. Likewise, the second time I called the first function (for Scores2 ...

Using D3-GraphViz in Javascript along with an Angular template: A step-by-step guide

I am attempting to integrate d3-graphviz following the guidance provided here within an angular template, like in this example. The tutorial on the d3-graphviz website advises me to include the following code in the index.html file: <!DOCTYPE html> & ...

"Utilizing the link_to method in Ruby on Rails to track click

I have 3 links with images. Each time a link is clicked, I want to increase my count by 1. <a href="/home" id="push"><img src="/images/image1.gif" /></a> <a href="/faq"> <img src="/images/image2.gif" /></a> <a href=" ...

Having trouble with errors when adding onClick prop conditionally in React and TypeScript

I need to dynamically add an onClick function to my TypeScript React component conditionally: <div onClick={(!disabled && onClick) ?? undefined}>{children}</div> However, I encounter the following error message: Type 'false | (() ...

What can Yeoman do with php files?

How can I set up Yeoman (latest version: v0.9.6) to serve php files? I came across this post but couldn't get it to work. I installed https://github.com/fgnass/gateway, https://github.com/fgnass/tamper and made the necessary updates to Yeoman accor ...

Double trigger caused by selection and modification events

I'm struggling to find a solution for this particular issue. I have implemented a textbox-like control that utilizes .select and .change events. As the user types, the textbox provides options to select from. The issue arises when selecting a value t ...

Angular form displayed on the screen

I'm having trouble finding a solution to this issue, as the form data is not being output. var app = angular.module('myApp', []); app.controller('mainController', ['$scope', function($scope) { $scope.update = funct ...

Visual Matrix and Directional Controls

I'm currently learning JavaScript and I've put together this script from different sources to help me grasp the basics. I prefer to keep it simple and would appreciate explanations if it gets too complex. Don't assume I know too much about i ...

Enhancing one's comprehension of precompiling JavaScript

var foo=1; function bar(){ foo=10; return; function foo(){} } bar(); alert(foo); As I delve deeper into the inner workings of JavaScript running on the machine, I stumbled upon this code snippet. Despite my best efforts, I am perplexed as to why the ...

Error message: The index expression for the Three.js array must be a constant value

Encountered an issue with Three.js where using an array with a non-constant index resulted in the error message: '[]' : Index expression must be constant When working with the following fragment shader: precision mediump float; varying vec2 ...

Is there a way to use JSON.stringify() to post multiple arrays at once?

Trying to send multiple arrays to the controller using Ajax post. Initially, there is a model structured like this: public class EnrollmentOptionsVM { public virtual string OptionID{ set;get;} public virtual string UserChoice { set;get;} p ...