开发者

Using external CSS in jQuery UI dialogs

Across my application, I need to load a content block into a jQuery UI dialog. Each content block must be CSS-styled individually.

I can only think of two solutions, neither of which is ideal:

  • Use jQuery.load() to load a partial HTML page (i.e. no <head> or <body> tags) containing the content block inside the dialog. The external CSS file would th开发者_开发知识库en dynamically be appended using jQuery. The dialog can automatically resize to fit the content.
  • Use an iframe to load an entire page, which contains the content block and the external CSS references all in one page. But the dialog can't automatically resize.

Are there any better solutions?


Hi in that case you can put the style in the top of the page you are loading inside a style tag <style></style> instead of using css file


you can add css properties to contents using jQuery css() also

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜