felixhagspiel / jsOnlyLightbox

Responsive Lightbox in plain JS. No need for jQuery.
MIT License
157 stars 51 forks source link

Style attribute manipulation fixes #42

Open marklindhout opened 5 years ago

marklindhout commented 5 years ago

Fixed overwrites of previously-set style properties on DOM objects, like the <body>. This was causing problems if you, for example, had a background-image css property set on the body, and opened a jsOnlyLightBox. Since the lightbox overwrote the entire style property, all other previously set properties were lost. This is now fixed by setting style properties using the style array method: obj.style['background-image'] = 'url(logo.png)';

This pull request contains the changed lightbox.js file, and the compressed and mangled lightbox.min.js too. I used uglify-js -m -c to generate this minified file.