laramichaels
laramichaels

Reputation: 1505

jquery-ui dialog: set dialog properties in HTML/CSS?

This is a trivial question, but: do you know if it is possible to define the properties of a Jquery-UI dialog in the HTML/CSS of the corresponding DIV? The docs just show how to do it in Javascript.

Thanks for any help

l

Upvotes: 0

Views: 6184

Answers (2)

Minras
Minras

Reputation: 4346

It is possible. You can define custom properties for your HTML tag like <div dialogwidth="400"></div> This will work but this won't be valid. In HTML5 you can create custom attributes (more discussion here).

You can also create invisible tag and keep settings inside it:

<div id="dialog">
    Dialog text.
    <div style="display: none;" class="dialog-width">400</div>
</div>
<script>
alert("Dialog width is " + $("#dialog") + "px");
</script>

But this solution is not elegant.

Upvotes: 1

Steven
Steven

Reputation: 19425

Things like max-height/width, display and other default CSS properties, can be controlled in CSS. But other jQuery specific properties, can only be set in you javascript file.

Upvotes: 0

Related Questions