Change CSS rule in class using JQuery

前端 未结 8 1387
我在风中等你
我在风中等你 2020-12-05 04:40

I have a class in CSS

.Foo
{
  width:20px;
}

Using Jquery I would like to do something similar to this on an event:

$(\".Fo         


        
8条回答
  •  感动是毒
    2020-12-05 05:19

    you could add the styling manually to the header with jquery:

      $('head').append('');
    

    then change it on an event like e.g. so:

      $(window).resize(function(){
         $('#addedCSS').text('.Foo {width:80px;}');
      });
    

提交回复
热议问题