javascript - bootstrap3 - toggle class name by @media -


i search class toggle switches changing resolution. in case when resolution changes @screen-lg or @screen-md - class should toggle btn-lg

@screen-sm (standart)

<a class = "btn btn-default btn-sm">button</a> 

@screen-lg or @screen-md (toggle)

<a class = "btn btn-default btn-lg">button</a> 

i think solution using jquery, need little this. please can me. or there solution more easyier?

thx

you can use same breakpoints bootstrap uses media queries change size of button:

/*default state (btn-sm styles)*/ .btn {     padding: 5px 10px;     font-size: 12px;     line-height: 1.5;     border-radius: 3px; } /*md or lg screen (btn-lg styles)*/ @media (min-width: 992px) {     .btn {         padding: 10px 16px;         font-size: 18px;         line-height: 1.33;         border-radius: 6px;     } } 

note: example above apply behavior .btn elements, can use custom class if want limit selection

demo fiddle


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -