开发者

Can anyone explain how/why to use jQuery's CSS hooks?

I have been looking into jQuery's css hooks, and some that are available on Github. I have been able to use them to set some styles with jQuery, but as far I understand it, it only gives me an overly complex way to set a css style. I am obviously missing the point... What can I do with them? Can I make Opera support css columns for example? if so, how? Thanks for your help!

$(".s开发者_如何学编程ub").css({
            'columnWidth':'120px',
            'columnRuleStyle':'dotted',
            'columnRuleWidth':'1px',
            'columnRuleColor':'#ccc',
            'columnGap':'10px'
            });


By adding support for these new or browser specific CSS properties it yes allows you to set then with the $.fn.css() function but it also adds the ability to animate them, which is the main uses for the hooks.

http://proj.jetless.org/AWESOME-TIME/


csshooks is good way to implement the new css3 styles across browsers. You can create a csshook plugin for the border-radius which does feature detection and implemented border-radius differently on browsers that support it. Explains it all right here:

http://api.jquery.com/jQuery.cssHooks/


From the sound of things, these CSS hooks are useful for supporting browser specific CSS properties that the core .css() function does not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜