javascript - How to apply "-webkit" css rules using jquery .css -


hey fellas , ladies,

i'm having issue applying following css rule.

$('#bam').css({"-webkit-overflow-scrolling": "touch"}) 

is applying -webkit stuff supported in jquery being nonstandard rule? when apply nothing happens , no error occurs.

however if the same syntax , change color works.

as use case im trying fix issue iphone iframe overflow problem see iframe size css on ios current issue , im not in position use inline styles or external css.

any ideas :)?

added jsbin example.

https://jsbin.com/vizacezeva/edit?html

<!doctype html> <html> <head> <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>   <script>     $( document ).ready(function() {       $('#bam').css({"overflow-scrolling": "touch"})       console.log('hi');            console.log($('#bam').css("overflow-scrolling"));     });   </script>    <meta charset="utf-8">   <title>js bin</title> </head> <body>   <div id="bam" style="width:100%; padding:0px;">       <iframe src="http://www.jsbin.com" style="width:1px; min-width:100%; max-width:100%;">       </iframe>   </div> </body> </html> 

instead of adding css rule jquery can declare rule in css file , add class applies style.

/** style.css **/ .foo { -webkit-overflow-scrolling: touch; }   // app.js $('#bam').addclass('foo'); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -