Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery change media query width value

Is it possible with jQuery or anything else to change width value of @media query css while page is running?

So for example if in style.css I've got

@media screen and (min-width: 400px) {
   /*whatever*/
}

to change it to 500px after website is loaded

like image 552
Adam Pietrasiak Avatar asked Jun 17 '13 12:06

Adam Pietrasiak


1 Answers

This is not possible through traditional method. You have to insert the full css through jQuery. For e.g :

 $('body').append("<style type='text/css'>@media screen and (min-width: 500px) { /*whatever*/ }</style>");
like image 112
Rajiv007 Avatar answered Oct 31 '22 18:10

Rajiv007