javascript - Disable jQuery-defined styles when printing -


i have page number of features , styles defined through jquery on document-ready , window-scroll, , made sure degraded nicely javascript disabled. however, throwing "print" stylesheet scraps of stylizations, , when tested realized jquery methods kicking in when printing , adding in background images. possible disable javascript or jquery, or particular function, when printing?

the biggest problem piece, generates random background image based on number generated earlier...it overriding print stylesheet's call background-image:none, when using !important tag:

$(document).ready(function() {     $("body").css({backgroundimage: 'url(images/body_bg_'+background+'.jpg)'}); }); 

thanks!

define styles in stylesheet. use javascript change dom cause styles applied element, instead of modifying style property.

this lets keep control of different media, , maintain separation of concerns (semantics, presentation , logic).

@media screen {    body.something {        background-image: url(images/body_bg_something.jpg);    } }  $(document).ready(function() {     $("body").addclass('something'); } 

that said:

it overriding print stylesheet's call background-image:none, when using !important

it shouldn't able that.


Comments

Popular posts from this blog

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

apache - Add omitted ? to URLs -

php - How can I stop spam on my custom forum/blog? -