Using css transform property in jQuery

前端 未结 5 593
广开言路
广开言路 2020-12-24 10:53

How can you specify cross-browser transform controls using jQuery since each browser seems to use its own methodology?

Here is the code I am using for Firefox but I

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 11:10

    I started using the 'prefix-free' Script available at http://leaverou.github.io/prefixfree so I don't have to take care about the vendor prefixes. It neatly takes care of setting the correct vendor prefix behind the scenes for you. Plus a jQuery Plugin is available as well so one can still use jQuery's .css() method without code changes, so the suggested line in combination with prefix-free would be all you need:

    $('.user-text').css('transform', 'scale(' + ui.value + ')');
    

提交回复
热议问题