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()?