Should jQueryUI apply styles automatically

寵の児 提交于 2019-12-08 04:30:21

问题


I've created a theme and applied it to my ASP.NET MVC site. However, the elements on the page aren't picking up the styles automatically. If I do the following for a specific element they get applied appropriately:

$("input[type=button]").button();
$("input[type=submit]").button();

Am I right in thinking I need to do this for all the different elements? Perhaps incorrectly, I assumed this would be done automatically by referencing the css and custom js files?

Thanks


回答1:


you can write :submit instead of input[type=submit], but I know that's no the answer of your question.

The jQuery UI library only provides code to style your website, but it doesn't do it automatically. So what you need to do is something like this:

$(":submit, :button, :reset").button();

But sometimes you want to use icons or something like this, then you can use

$("#specificButton").button("option", "...", "...");

I hope it helps!



来源:https://stackoverflow.com/questions/3846624/should-jqueryui-apply-styles-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!