<div dir="ltr">Hi guys,<div><br></div><div>I am currently creating a JQDialog. Such an object allows one to define a &#39;width&#39;. But it can only be passed a number (pixels). In my case I want a special default..say $(window).width() * 0.9</div>
<div><br></div><div>I tried many ways of dealing with that and I failed completly. The way I create the script is this:</div><div><br></div><div>scriptToOpenDialogOn: html value: value <br></div><div><br></div><div><div>((html jQuery: &#39;#popupContainer&#39;) dialog close),</div>
<div><span class="" style="white-space:pre">                </span>((html jQuery: &#39;#popupContainer&#39;) dialog</div><div><span class="" style="white-space:pre">                                        </span>title: value second;</div><div><span class="" style="white-space:pre">                                        </span>html: value first;</div>
<div><span class="" style="white-space:pre">                                        </span>modal: false;</div><div><span class="" style="white-space:pre">                                        </span>autoOpen: true;</div><div><span class="" style="white-space:pre">                                        </span>draggable: true;</div>
<div><span class="" style="white-space:pre">                                        </span>resizable: false;</div><div><span class="" style="white-space:pre">                                        </span>position: &#39;top&#39;;</div><div><span class="" style="white-space:pre">                                        </span>closeOnEscape: true;</div>
<div><span class="" style="white-space:pre">                                        </span>width: 900;</div><div><span class="" style="white-space:pre">                                        </span>addButton: &#39;Close&#39; do: (html jQuery: &#39;#popupContainer&#39;) dialog close)</div><div>
<span class="" style="white-space:pre">                                        </span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">And that is appended to #script: of an ajax callback:</span></div>
<div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">scriptForPopupClickHandlerOn: html

        | val |
        val := ValueHolder new.
        ^ html jQuery this
                on: &#39;click&#39;
                selector: &#39;.clickablePopup&#39;
                do: ((html jQuery ajax 
                                callback: [:pass | val contents: pass first ]
                                passengers: (html jQuery this);
                                script: [ :s |  
                                        s &lt;&lt; (self scriptToOpenDialogOn: s value: val contents) ]) asFunction: #(event))
                                                                </span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">Any ideas how could i make those 900 pixels to be a % of say..the width of the root document?</span></div>
<div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">Thanks in advance,</span></div><div><span class="" style="white-space:pre"><br></span></div><div><br></div>-- <br>Mariano<br>
<a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
</div></div>