beefchimi
beefchimi

Reputation: 1308

Fancybox remove added styles

I am using Fancybox 2 on a site and noticed when I Inspect Element, some of the divs have a "style" attribute with some CSS in there.

All of this I can do in my styles.css, so I would like to know how to remove these added "style" attributes, or at least remove things like padding and top / left positioning.

Upvotes: 1

Views: 1858

Answers (3)

Simon Gottesman
Simon Gottesman

Reputation: 11

I did this by adding the following code: $("#div_for_overlay").css({'width': '800px', 'height': '400px'});

And setting padding:0 in the fancibox.js file instead of padding:15px

This removed the inline styles for fancybox-overlay

To remove the same for fancybox-inner and fancybox-outer divs, just do the same. See if you can edit with some jquery code like so $(".fancybox_outer").css({'width': '800px', 'height': '400px'});

And if not, find where it is being set in the fancybox.js file and edit inline. That should work.

Upvotes: 1

beefchimi
beefchimi

Reputation: 1308

I am updating to say that, after trying everything, there seems to be no way at all to remove the inline styles added by Fancybox. I am accepting this as the correct answer, even though it really isn't much of an answer. If anyone does find a solution, I would love to hear it.

Upvotes: 1

Fermis
Fermis

Reputation: 181

You can use Jquery .CSS() to set the padding to 0, or use .removeAttr() to remove all styling and you could add your own class to it.

Upvotes: 0

Related Questions