0

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

laramichaels
  • 1,515
  • 5
  • 18
  • 30

2 Answers2

1

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.

Community
  • 1
  • 1
Minras
  • 4,136
  • 4
  • 18
  • 18
0

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.

Steven
  • 19,224
  • 47
  • 152
  • 257