Jump to content

Noise effect header with JS injection

Recommended Posts

Hi everyone !

I'm stuck with some code... I would like to have just my header with a noise effect. I can make the script work, but the noise effect is below and behind the header.

1 - What should I do to get it in front of the header?
2 - Can we make it work with a hidden scroll header as well?


Thanks ! Danke ! Merci !

Laetitia

Capture d’écran 2024-08-07 à 15.39.29.png

Link to comment
  • Replies 5
  • Views 770
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

39 minutes ago, Letgop83 said:

Hi everyone !

I'm stuck with some code... I would like to have just my header with a noise effect. I can make the script work, but the noise effect is below and behind the header.

1 - What should I do to get it in front of the header?
2 - Can we make it work with a hidden scroll header as well?


Thanks ! Danke ! Merci !

Laetitia

Capture d’écran 2024-08-07 à 15.39.29.png

Can you share your URL and the script you are using to make the noise effect so we can check it more easily?

Press 👍  or mark my comment as solution if you find my sharing useful

🆒 Squarespace pinchzoom lightbox plugin (affiliate link)

👁‍🗨 360 degree photo viewer (affiliate link)

Link to comment
Posted (edited)

https://laetitiaheisler.com

I followed these steps from:

 

And i used the code in header injection:

 

<div id="#header">
    <div class="grained"></div>
</div>

 

Script and CSS

<script src="https://cdn.rawgit.com/sarathsaleem/grained/master/grained.js"></script>
<script> var options = {
  "animate": true,
  "patternWidth": 100,
  "patternHeight": 100,
  "grainOpacity": 0.02,
  "grainDensity": 1,
  "grainWidth": 1,
  "grainHeight": 1
}
grained("#header", options);

/*
background-color :rgb(204, 204, 204)
*/
</script>
#header  {
  z-index: 1!important;
}

#page {
  z-index: -1!important;
}
Edited by Letgop83
just a detail to say
Link to comment
On 8/7/2024 at 10:24 PM, Letgop83 said:

https://laetitiaheisler.com

I followed these steps from:

 

And i used the code in header injection:

 

<div id="#header">
    <div class="grained"></div>
</div>

 

Script and CSS

<script src="https://cdn.rawgit.com/sarathsaleem/grained/master/grained.js"></script>
<script> var options = {
  "animate": true,
  "patternWidth": 100,
  "patternHeight": 100,
  "grainOpacity": 0.02,
  "grainDensity": 1,
  "grainWidth": 1,
  "grainHeight": 1
}
grained("#header", options);

/*
background-color :rgb(204, 204, 204)
*/
</script>
#header  {
  z-index: 1!important;
}

#page {
  z-index: -1!important;
}

Can you add & keep code? We can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

yes

<div id="????">
    <div class="grained"></div>
</div>
<style>

<script src="https://cdn.rawgit.com/sarathsaleem/grained/master/grained.js"></script>

<script>

var options = {
  "animate": true,
  "patternWidth": 500,
  "patternHeight": 269.38,
  "grainOpacity": 0.3,
  "grainDensity": 4.88,
  "grainWidth": 4.77,
  "grainHeight": 8.2
}
grained("#???????", options);

</script>

I would like to have the noise effect just for the header 🙂
Any suggestion ?

Thanks !

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.