Link to home
Start Free TrialLog in
Avatar of sandshakimi
sandshakimiFlag for United States of America

asked on

How to remove a CSS attribute using jQuery?

There is a DIV with class name home-page-rotater

It has an inline style with width and height I want to remove.

I'm having a challenge trying to find where this code sits. It's for a slide-show on a Drupal site but I can't find where it's hard coded.

So I'm thinking just to remove those two with some jQuery.  What's the best way?
ASKER CERTIFIED SOLUTION
Avatar of Md Shah
Md Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scott Fell
Sometimes the code is generated via javascript.    What is the link to  your site?

An easier way is to use css.  Place this at the bottom of your custom css.  Choose one optioin.  The first one, visibility:hidden will retain the shape of the div but hide the contents. display:none will allow the other html to collapse.  

div.home-page-rotater {visibility:hidden;}

Open in new window

div.home-page-rotater {display:none;}

Open in new window

Avatar of sandshakimi

ASKER

Some reason, the jQuery is not taking on my site.

The site is behind a firewall so I can't share the link, but this site, www.serve.gov, has the exact same slideshow on the home page and the div with class,  home-page-rotater

I suspect the W & H is being dynamically generated, so I want to nix it upon page load completion.
>The site is behind a firewall
The easy fix is to push the content to a public url. You can also try and recreated the rendered code to http://jsbin.com/ but that could be a lot more work than necessary.

The serve.gov has their rotator content under the div with id home-rotator.  You may have something completely different.