jQWidgets Forums

jQuery UI Widgets Forums General Discussions Dialogs and Notifications Window Window content visible when window isn't open

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • jimg
    Participant

    I have divs defined to make a window as follows:

    <div id="selectOrder">
    <div>Get Order</div>
    <div>
    <div id="orders" style="white-space:nowrap;"></div>
    <a id="cancelOrders" href="javascript:void(0)" class="b_lnk" style="float:right;">Cancel</a>
    </div>
    </div>

    Here’s the code that adds a click handler to my cancel button and then opens the window:

    $('#cancelOrders').bind('click', function(){ $('#selectOrder').jqxWindow('close'); });
    $("#selectOrder").jqxWindow({ theme: foo.theme, isModal: true, position: { x: 160, y: 170 }, width:'auto', height:'auto', animationType:'none', autoOpen: false });
    $('#selectOrder').jqxWindow('open');

    The div with the id=”orders” gets populated from some ajax data before the window is shown. The problem is that the link that makes the cancel button (id=”cancelOrders”) is visible on the page before the window is opened. I know I could use a jqx cancel button. I even tried that, but that cancel button was visible before the window was opened too. I can use jquery to show and hide the link when I open and close the window, but I shouldn’t have to. What do I do to make the link not be visible when the window isn’t open, and be visible when it is open without calling .hide() and .show()?


    Peter Stoev
    Keymaster

    Hi jimg,

    That is expected because of the fact that while your script is loaded your HTML is visible so you could probably set the CSS visibility to “hidden” of your Link and in document.ready select it with jQuery and set it back to “visible”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    jimg
    Participant

    Really?

    I would think the autoOpen: false property would set the visibility of the window content to hidden when .jqxWindow() was initially called for the nested divs.


    Peter Stoev
    Keymaster

    Hi jimg,

    As far as I know, widgets are initialized in document.ready i.e when all scripts are loaded. While the document.ready is called, your HTML parts could be visible.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.