Hi All,
I don't know if this is a bug or a feature by design hidden in some specification somewhere, I thought I would share (discuss?)
In order to create a dialog, I need what I refer to as a place holder. All examples I have seen have used the div tag as a place holder - thus
<div id="dialogPlaceHolder">this is my message text</div>
and to display this in a basic dialog box that is 500px wide, 500px high one could do the following:
var dialogOpts={ height: 500, width: 500, buttons:{ "Yes": DialogYes, "No": DialogNo } };
$("#dialogPlaceHolder").dialog( dialogOpts );
The above makes the assumption that I have two other functions called DialogYes() and DialogNo() - Their purpose in life makes no change to my observation.
When the above dialog opens, I am presented with a 500px x 500px box.
If I change dialogPlaceHolder from div to span, thus
<span id="dialogPlaceHolder">this is my message text</span>
I get a box that fits snugly around my message text. The dialogOpts works otherwise as expected (meaning my smaller snug fitting Dialog box has buttons and any other settings I define there.
I prefer to use span as opposed to div tags, since div tags can incur a new line on the browser even if their contents are not displayed. So my question to you fine chaps and chapessessesss is, is this a bug, or is there a good reason as to why the Dialog behaves differently when I use a span tag instead of a div tag?
Thanks