Title: Can’t do Transparent header using JS &amp; CSS
Last modified: October 11, 2022

---

# Can’t do Transparent header using JS & CSS

 *  [beefmannn5](https://wordpress.org/support/users/beefmannn5/)
 * (@beefmannn5)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/cant-do-transparent-header-using-js-css/)
 * I’m trying to do transparent header and I found this code online:
    CSS: body {
   min-height:800px; } .ehf-header header { z-index: 30; position: fixed; width:
   100%; top: 0; } .changebackground{ background-color:white; transition: background
   500ms ease-out; }
 * JS:
    jQuery(window).ready(function() { jQuery(window).scroll(function() { var
   scroll = jQuery(window).scrollTop(); if (scroll > 100) { jQuery(“header”).addClass(“
   changebackground”); } else { jQuery(“header”).removeClass(“changebackground”);}});});
 * The developer online said: to change the class to my header class, which his:#
   masthead
    so I switched the “header” in JS to “#masthead”
 * P.S: the css code that do the Sticky style worked, only the transparent didn’t.
    -  This topic was modified 3 years, 8 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Developing with WordPress
      topic

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Vishakha Gupta](https://wordpress.org/support/users/vishakha07/)
 * (@vishakha07)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/cant-do-transparent-header-using-js-css/#post-16088745)
 * Hi [@beefmannn5](https://wordpress.org/support/users/beefmannn5/),
 * Could you please share your site URL, so I can help you to get the desired solution?
 * Thanks
 *  Thread Starter [beefmannn5](https://wordpress.org/support/users/beefmannn5/)
 * (@beefmannn5)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/cant-do-transparent-header-using-js-css/#post-16089709)
 * [@vishakha07](https://wordpress.org/support/users/vishakha07/) Sure mate thank
   you.
 * [https://ofekzaramati.com/](https://ofekzaramati.com/)
 *  [Vishakha Gupta](https://wordpress.org/support/users/vishakha07/)
 * (@vishakha07)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/cant-do-transparent-header-using-js-css/#post-16091245)
 * Hi [@beefmannn5](https://wordpress.org/support/users/beefmannn5/),
 * Currently, you are using elementor and using this you can easily manage the header
   background colour without adding custom CSS and js. You can check the video tutorial
   for this.
    [https://elementor.com/help/sticky-transparent-header/](https://elementor.com/help/sticky-transparent-header/)
 * Thanks
 *  Thread Starter [beefmannn5](https://wordpress.org/support/users/beefmannn5/)
 * (@beefmannn5)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/cant-do-transparent-header-using-js-css/#post-16093421)
 * [@vishakha07](https://wordpress.org/support/users/vishakha07/) hey man thanks
   for the response.
    The article is about elementor pro, I don’t have elementor
   pro, that’s why I’m trying to do this with clean code

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Can’t do Transparent header using JS & CSS’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [beefmannn5](https://wordpress.org/support/users/beefmannn5/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/cant-do-transparent-header-using-js-css/#post-16093421)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
