"Enhance Your Website with our Fully Immersive Blur Filter Navigation

I am trying to create a full page navigation that will fade in and act as a filter, blurring the entire screen except for the navigation, when a user clicks the menu button. I have attempted using CSS blur filters and SVG filters but have not been successful so far. Is there something crucial that I may be missing?

$('.nav').hide();
$('.hamburger').click(function(){
    $('.nav').fadeToggle('slow');
    $('.hamburger div').toggleClass('turn-white');
});
$('.nav-dropdown-toggle > span > a, .navigation > li > a, .nav-dropdown > li > a').click(function(){
    $('.nav').fadeToggle('slow');
    $('body').toggleClass('disable-scroll');
});
.nav{
    height:100vh;
    width:100%;
    position:fixed;
    z-index:5;
    display:none;
    text-align:right;
}
#nav_bg{
    height:100%;
    width:100%;
    position:absolute;
    z-index:100;
    background-color:rgba(0,0,0,0.5);
    filter: blur(15px);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class="hamburger">Menu Button</button>

<div class="nav">
        <div id="nav_bg"></div>
        <ul class="navigation">
            <li class="nav-dropdown-toggle"><span><a href="#packages">Packages</a></span>
                <ul class="nav-dropdown">
                    <li><a>Business Packages</a></li>
                    <li><a>Top Producers</a></li>  
                    <li><a>Video Ads</a></li>  
                    <li><a>Proud Community Sponsor</a></li>  
                </ul>
            </li>
            <li><a href="#campaigns">Campaign Options</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">Log In</a></li>
            <li>
                <a href="https://www.facebook.com/Supporting-Our-Community-com-1081805428499269/?ref=hl" class="social"><img src="img/402-facebook2.svg"></a>
                <a href="https://www.youtube.com/channel/UCvmPcOGA69v2onNJHDAFwYg" class="social"><img src="img/414-youtube.svg" style="width:47px;"></a>
                <a href="https://www.linkedin.com/in/SupportingOurCommunity" class="social"><img src="img/458-linkedin.svg"></a>
            </li>
        </ul>
    </div>

<div class="example-content">
<h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> <h3>THIS SHOULD BE BLURRED</h3> <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> <h3>THIS SHOULD BE BLURRED</h3> <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 
  <h3>THIS SHOULD BE BLURRED</h3> 

Answer №1

To blur the main content from your script, you can target it as well:

$('.nav').hide();
$('.hamburger').click(function(){
    $('.nav').fadeToggle('slow');
    $('.hamburger div').toggleClass('turn-white');
    $('.example-content').toggleClass('blur');
});
$('.nav-dropdown-toggle > span > a, .navigation > li > a, .nav-dropdown > li > a').click(function(){
    $('.nav').fadeToggle('slow');
    $('body').toggleClass('disable-scroll');
});
.nav{
    height:100vh;
    width:100%;
    position:fixed;
    z-index:5;
    display:none;
    text-align:right;
}
#nav_bg {
    height:100%;
    width:100%;
    position:absolute;
    z-index:100;
   background-color:rgba(0,0,0,0.5);
}
.blur{

    filter: blur(5px);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class="hamburger">Menu Button</button>

<div class="nav">
        <div id="nav_bg"></div>
   ... (content continues) ...
  <h3>THIS SHOULD BE BLURRED</h3>

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

Assigning a background image based on the quantity of items in an array or object

I'm having trouble appending divs and setting their background image based on the number of items in an array or object. Despite adding the divs correctly, all of them end up with the same background image when only three should have it. Can someone e ...

The drop-down menu remains in the open position following a responsive test

Seeking assistance with a minor issue... I've incorporated a jQuery mobile menu into my responsive web design. When testing the responsiveness by adjusting the browser window size, everything seems to be working correctly. However, upon resizing it b ...

Bootstrap's hidden navigation bar feature

I noticed that my navbar changes from transparent to opaque when scrolling. I am trying to achieve a similar effect like the one in this example: https://i.sstatic.net/00uPM.png Initially, my navbar looks like this: https://i.sstatic.net/iMyYL.png As y ...

Is there a way to accomplish this task with the HighCharts library?

Being new to Highcharts, I am currently working on a dashboard where I aim to showcase the percentage usage of equipment at a specific Plant. Despite reviewing various demos provided by Highcharts, I have not come across a similar example. This is the spe ...

`Moving objects issue within a relative parent container`

Here's the issue I am facing - while using prototype and scriptaculous (although jquery may have the same problem), I have a list of draggable images within a div that is relatively positioned. The challenge arises when I try to drag these images out ...

The styles within a media query are not being successfully implemented

update: issue resolved. I discovered that there was a lingering media query in the css file that was meant to be removed. Also, I corrected some errors in the code. Thank you all for your help – it's now working perfectly. I have a set of html and ...

What is the process for attaching an on-click event listener by utilizing an argument that is passed to a function in JavaScript?

These are the functions I have created: function type(message) { document.getElementById("body").innerHTML="<div id=\"textbox\" class=\"textbox\"></div><div id=\"oc\&q ...

Challenges arise when dealing with the dimensions of a webpage while loading it with Jquery

Having an interesting problem here - I'm utilizing Jquery to load an HTML content into a Div element, however, strangely enough, the width and height are not adjusting as expected. Here's the snippet causing the trouble: $("#middlebox").html(&ap ...

Tips on gathering information from an HTML for:

After encountering countless programming obstacles, I believe that the solution to my current issue is likely a simple fix related to syntax. However, despite numerous attempts, I have been unable to resolve it thus far. I recently created a contact form ...

Encountering the error message "value is not defined" when using a React range slider

I recently tried setting up the nodejs react range slider component by following the instructions provided on https://www.npmjs.com/package/react-rangeslider. Despite installing all the necessary dependencies, I keep encountering an error message stating ...

Tips on vertically centering a div within another div

Greetings, I wanted to share the code snippet I am currently using: https://jsfiddle.net/hbahar95/27/ .text.ellipsis { position: relative; font-size: 14px; color: black; font-family: sans-serif; width: 250px; /* You can adjust this as needed ...

Tips on creating a slow and gradual border animation that unfolds smoothly

I am looking to create an animation effect on a border, gradually revealing it like in this Codepen example. However, my specific requirements are: The previous line should not be removed, but rather shown along with the new border. The border color ...

Can an arrow be crafted to direct a player towards their final destination?

I'm currently developing a game that utilizes numerical tile maps, such as [1, 0, 0, 1], and I am using JavaScript to display these maps on a canvas. I have been struggling to create an arrow that consistently rotates to point towards an end goal, des ...

I have a dynamic blog site that is generated on the fly using Ajax, making the content unsearchable

I have a blog website that is created dynamically using Ajax (XMLHttpRequest) and the HTML History API. One issue I am facing is that my content is not searchable by search engines like Googlebot. I know that Google is now able to analyze such sites, but w ...

The Mysteries of Key Codes in JavaScript

I'm curious about the character codes used for keyboards. Recently, I came across an informative article discussing this topic. In particular, I am interested in finding out which key code to use when a user presses both the alt and down arrow keys s ...

Display or conceal a div element using a dropdown menu selection

I have implemented the following code, which is currently functional and was sourced from a different thread on Stack Overflow: <Select id="colorselector"> <option value="red">Red</option> <option value="yellow">Y ...

Utilizing jQuery to incorporate two datepickers for two separate fields (field 1 and field 2 with the second date being one day ahead), similar

How are you feeling? I am currently working with two datepickers, each associated with its own field. My goal is for the user to automatically select (From) and have the second field (TO) display the following day, similar to how it works on booking.com. ...

How can I locate a div element using multiple class names?

<div class="value test" /> I am trying to locate this specific element on the web page which has two classes assigned to it. Since className does not accept space-separated values, I am exploring alternative ways to achieve this. Any suggestions? ...

Ways to manage intricate HTML tables using Beautiful Soup

Currently, I am facing an issue while loading an HTML file into a data frame using BeautifulSoup. The table I am parsing contains a nested table in every row, and I am unsure of how to handle this situation as it is resulting in an AssertionError. The prob ...

Combining MySQL tables for main menu and subcategories

Working on a new project and seeking help with a certain situation. I have a SQL database featuring two tables: menu and submenu. The table structure is as follows: Menu: id | title | order Submenu: id | title | parentId Currently, I'm using two si ...