Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #19925
| From | Christoph Becker <cmbecker69@gmx.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: How can this work as it does |
| Date | 2013-05-24 17:21 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <kno0h2$1se$1@speranza.aioe.org> (permalink) |
| References | <knn912$659$1@dont-email.me> <knnt86$ujj$1@softins.clara.co.uk> |
Tony Mountifield wrote:
> In article <knn912$659$1@dont-email.me>,
> Tony <tony.johansson@inport.com> wrote:
>> This code works as it should but there is one thing that
>> I don't fully understand.
>>
>> In the html markup at the end I have this div
>> <div id="dlgInsertLots" title="Insert Lots" style="width:500px;
>> display:none">
>> ...
>> which is not displayed because we have said display:none
>>
>> Now to my question when I click on button with id= InsertLots this function
>> Click_InsertLots is called.
>> function Click_InsertLots()
>> {
>> //Create and display dialog dlgInsertLots
>> $("#dlgInsertLots").dialog({
>> width:700
>> });
>> }
>>
>> but this div with id=dlgInsertLots is displayed which is the behaviour that
>> I want.
>> What I want to know is why is it displayed now but not when the html page
>> was displayed the first time.
>> I don't want to change anything because it works perfect but I don't
>> understand how it can work as it does.
>
> When you use an inline style, that style is treated as a single entity.
> So it would appear you are replacing the style "width:500px; display:none"
> with the style "width:700". That overwrites the complete inline style, and
> the replacement style doesn't include "display:none".
Actuallys jQueryUI's $(...).dialog() "method" sets the diplay property
of the element(s) to "block", no matter what's passed as parameter. See
<http://api.jqueryui.com/dialog/>.
--
Christoph M. Becker
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How can this work as it does "Tony" <tony.johansson@inport.com> - 2013-05-24 10:44 +0200
Re: How can this work as it does "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-05-24 11:09 +0200
Re: How can this work as it does Tim Streater <timstreater@greenbee.net> - 2013-05-24 12:55 +0100
Re: How can this work as it does JJ <duh@nah.meh> - 2013-05-25 04:33 +0700
Re: How can this work as it does Tim Streater <timstreater@greenbee.net> - 2013-05-24 22:50 +0100
Re: How can this work as it does Christoph Becker <cmbecker69@gmx.de> - 2013-05-24 14:29 +0200
Re: How can this work as it does Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-24 22:13 +0000
Re: How can this work as it does Christoph Becker <cmbecker69@gmx.de> - 2013-05-25 00:56 +0200
Re: How can this work as it does tony@mountifield.org (Tony Mountifield) - 2013-05-24 14:25 +0000
Re: How can this work as it does Christoph Becker <cmbecker69@gmx.de> - 2013-05-24 17:21 +0200
Re: How can this work as it does JJ <duh@nah.meh> - 2013-05-25 04:30 +0700
csiph-web