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

3

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.