[jQuery] jqModal: having trouble centering modal window
Hi, I just downloaded the latest version of jqModal and its accompanying jquery file, but I'm not able to center my modal window using the same style sheet -- http://dev.iceburg.net/jquery/jqModal/jqModal.css . I only changed these lines margin-left: -267px; width: 535px; to reflect the width of my modal window. Here is how I'm displaying it: $(document).ready( function () { $('#editTitle').unbind('click'); $('#modalWindow').jqm({ modal: true, trigger: '#editTitle', autofire: true, focus: true, overlay: 30}, function(h) { $("#modalButtonSave").click (function() { $("#modalWindow").fadeOut("slow"); }); $("#modalButtonCancel").click (function() { $("#modalWindow").fadeOut("slow"); }); $("#modalWindow").fadeIn ("slow"); }); $('#modalWindow').jqmShow(); } ); Any ideas what else I'm doing wrong and why my window is not centering? Thanks, - Dave
[jQuery] Updating select menu from child window to the parent menu
Hi, >From the context of the child window, if I have a select menu with the id = "childMenu" and I want to copy all the options (both values and text exactly) a menu in the opener window with id="openerMenu", how do I do that? Thanks, - Dave
[jQuery] How to apply blur function to two classes?
Hi, I have to apply an onblur function to elements of type "numAdultsField" or "numChildrenField". How do I do that? This isn't working ... $(".numAdultsField .numChildrenField").blur(function() { var id = $(this).attr("id"); var eltPrefix = id.substring(0, id.toLowerCase().indexOf ("num")).replace(":", "\\:"); var numAdultsElt = $('#' + eltPrefix + 'NumAdults'); var numChildrenElt = $('#' + eltPrefix + 'NumChildren'); var total = 0; if (parseInt(jQuery.trim(numAdultsElt.val())) > 0) { total += parseInt(jQuery.trim(numAdultsElt.val())); } // if if (parseInt(jQuery.trim(numChildrenElt.val())) > 0) { total += parseInt(jQuery.trim(numChildrenElt.val())); } // if $('#' + eltPrefix + 'TotalInParty').val(total); }); - Dave
[jQuery] How do I trigger an event when a user presses a key within a text field?
Hi, What is the event that I trigger if a user enters (or deletes) a character within a textfield with id = "username"? Thanks, - Dave
[jQuery] How do I write an express to access all radio button elements?
Hi, I'm trying to access all radio button elements with this expression .. var expr = $("element[type='radio']"); but the experts among you know this isn't correct. What is the correct expression? Thanks, - Dave
[jQuery] How do I select all elements whose id's begin with ... ?
Hi, I'm using JQuery 1.3. How do I write an expression to select all elements whose id's begin with "DatePref"? These are all input type="text" elements if that matters. Thanks, - Dave
[jQuery] How do I unbind all onclick events from a button?
Hi, I'm using JQuery 1.3. I have a button and I want to completely clear it of any onclick events associated with it so that clicking it will do absolutely nothing. If I know the ID of the button, how do I do this? Thanks, - Dave
[jQuery] Re: How do I unbind all onclick events from a button?
I saw this, but that page only tells you how to unbind a specific function that you know in advance. This code ... $('.cancelAction').unbind('click', function(){} ); does not work for me as far as being able to cancel all the onclick actions associated with an element. Any other suggestions are welcomed, - Dave On Dec 15, 3:07 pm, "T.J. Simmons" wrote: > Try $("#id").unbind("click"); > > I've never used it before, but according > tohttp://docs.jquery.com/Events/unbind#typefn > that oughta do the job pretty nicely. > > - T.J. > > On Dec 15, 3:38 pm, "laredotorn...@zipmail.com" > > wrote: > > Hi, > > > I'm using JQuery 1.3. I have a button and I want to completely clear > > it of any onclick events associated with it so that clicking it will > > do absolutely nothing. If I know the ID of the button, how do I do > > this? > > > Thanks, - Dave
[jQuery] What is the event when a user presses the enter key anywhere on the page?
Hi, I would like to capture the event of pressing enter anywhere on the page, even if the focus of the mouse cursor is not on a text field. What event/element am I looking at? Thanks, - Dave
[jQuery] jquery sortable question
Hi, I'm using the sortable plugin with JQuery 1.3. After a list item has been moved to a new place, how do you get the new list item position -- i.e. it's now the 1st, 2nd, 3rd ... item in the list as opposed to its position on the screen? Here's how I'm declaring my sortable list ... $("#sortable").sortable({ revert: true, handle : '.adminPrinterHeader', update : function (event, ui) { /* What goes here? */ } }); // Thanks, - Dave
[jQuery] How do I extract this value?
Hi, I am using JQuery 1.3. I have this basic structure in my HTML ... ... ... ... How do I extract the "1234" from HTML assuming I know the id of the element? Thanks, - Dave ps - I know its bad practice to have the javascript function in there, but sadly this is code I inherited and I can't change the href at this point.
[jQuery] Re: How do I extract this value?
Perfect! 5 stars - Dave On Jan 2, 8:15 pm, MorningZ wrote: > var hit = $("#myid").find("a").attr("href").match(/^.+\((\d+)\)$/); > if (hit && hit.length == 2) { > // hit[1] = "1234" in the example you provided} > > else { > // didn't find the value > > } > > On Jan 2, 9:13 pm, "laredotorn...@zipmail.com" > > wrote: > > Hi, > > > I am using JQuery 1.3. I have this basic structure in my HTML ... > > > > > ... > > ... > > ... > > > > > How do I extract the "1234" from HTML assuming I know the id of the > > element? > > > Thanks, - Dave > > > ps - I know its bad practice to have the javascript function in there, > > but sadly this is code I inherited and I can't change the href at this > > point.
[jQuery] Can JQuery solve the iframe height=100% problem?
Hi, I'm trying to get my iframe to occupy 100% of its parent block element. But the height=100% attribute in CSS isn't doing the trick. Here's my HTML and the CSS ... iframe { display:block; height:100%; width:100%; border:none; } It doesn't look good right now -- http://screencast.com/t/mIzGnUikC. Can JQuery help me make my iframe occupy 100% of its parent element? Thanks, - Dave
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
Hi dbzz, I tried the code you provided, but went from this ... http://screencast.com/t/W8lOtgKO to the iframe disappearing entirely ... http://screencast.com/t/jCTjOLhpeX I put your code in a $(document).ready() block (below). Are there any other modifications I should make to get it to display at 100%? $(document).ready(function() { $('#fileTreeIframe').load( function() { var $ifbody = $(this).contents().find ( 'body' ); $ifbody.css( 'height','auto' ); $(this).height( $ifbody.height() ); }); }); Thanks, - Dave On Jan 25, 10:26 am, dbzz wrote: > let me change that - i actually went and looked at the place i had > this working and it goes like this - > > $('#fileTreeIframe').load( function() { > var $ifbody = $(this).contents().find( 'body' ); > $ifbody.css( 'height','auto' ); > $(this).height( $ifbody.height() ); > }); > > ...need more coffee. > > On Jan 25, 7:36 am, dbzz wrote: > > > > > see if this works. chances are that the iframe content hasn't loaded > > yet when onready runs, so bind the height change to the iframe load > > callback. > > > var $ifbody = $('#fileTreeIframe').contents().find( 'body' ); > > $ifbody.bind( 'load', function() { > > $('#fileTreeIframe').height( $ifbody.height() ); > > });- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
My iframe is also hard-coded. But here is what I get when I do console.log statements ... $('#fileTreeIframe').load( function() { var $ifbody = $(this).contents().find ( 'body' ); console.log($ifbody); // Outputs Object length=1 0=body prevObject=Object jquery=1.2.6 $ifbody.css( 'height','auto' ); console.log($ifbody.height()); // Outputs 0 $(this).height( $ifbody.height() ); }); Obviously the troubling thing here is that height is outputting zero. Can you provide the HTML that surrounds your hard-coded iframe? There must be something else I'm not setting in the CSS or HTML. Thanks, - Dave On Jan 25, 1:53 pm, dbzz wrote: > i have the iframe hardcoded in the html. if you are adding it to the > dom with js, it won't get the load event binding. you might try > livequery or something like it. > > On Jan 25, 10:21 am, "laredotorn...@zipmail.com" > > > > wrote: > > Hi dbzz, > > > I tried the code you provided, but went from this ... > > >http://screencast.com/t/W8lOtgKO > > > to the iframe disappearing entirely ... > > >http://screencast.com/t/jCTjOLhpeX > > > I put your code in a $(document).ready() block (below). Are there any > > other modifications I should make to get it to display at 100%? > > > $(document).ready(function() { > > $('#fileTreeIframe').load( function() { > > var $ifbody = $(this).contents().find > > ( 'body' ); > > $ifbody.css( 'height','auto' ); > > $(this).height( $ifbody.height() ); > > }); > > }); > > > Thanks, - Dave- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
Hi Kevin, How do I apply this expansion to the iframe specifically? I included this on my page ... $(document).ready(function() { $("body").layout({ closable: false , resizable: false , spacing_open: 0 }); }); but still no love! ... http://screencast.com/t/aJxegNZmv - Dave On Jan 26, 12:27 pm, Kevin Dalman wrote: > Hi Dave, > > This plugin may be more than you need, but... > > The UI/Layout widget will automatically position and size an iframe > (or other element) to fill the entire page, OR allow for a header, > footer, or sidebars. The code and markup are dead-simple. Here is an > example with a page-banner and an iframe. Everything is done for you, > including eliminating the 'body scrollbar'... > > $(document).ready(function(){ > $("body").layout({ > closable: false > , resizable: false > , spacing_open: 0 > }); > > }); > > [Banner here] > > > That's it! I recommend setting an iframe width & height for non- > Javascript browsers, but it's not necessary for Layout. Plus you must > set your preferred iframe options, like scrolling, border, padding, > etc. > > Plug-in website:http://layout.jquery-dev.net > > Simple iframe demo:http://layout.jquery-dev.net/demos/frames.html > > The Layout website itself used iframe pages with a 'banner', like: > > http://layout.jquery-dev.net/discuss.html > > Hope this helps. > > /Kevin > > On Jan 26, 6:55 am, "laredotorn...@zipmail.com" > > > > wrote: > > My iframe is also hard-coded. But here is what I get when I do > > console.log statements ... > > > $('#fileTreeIframe').load( function() { > > var $ifbody = $(this).contents().find > > ( 'body' ); > > console.log($ifbody); // Outputs > > Object length=1 0=body prevObject=Object jquery=1.2.6 > > $ifbody.css( 'height','auto' ); > > console.log($ifbody.height()); // > > Outputs 0 > > $(this).height( $ifbody.height() ); > > }); > > > Obviously the troubling thing here is that height is outputting zero. > > Can you provide the HTML that surrounds your hard-coded iframe? There > > must be something else I'm not setting in the CSS or HTML. > > > Thanks, - Dave > > > On Jan 25, 1:53 pm, dbzz wrote: > > > > i have the iframe hardcoded in the html. if you are adding it to the > > > dom with js, it won't get the load event binding. you might try > > > livequery or something like it. > > > > On Jan 25, 10:21 am, "laredotorn...@zipmail.com" > > > > wrote: > > > > Hi dbzz, > > > > > I tried the code you provided, but went from this ... > > > > >http://screencast.com/t/W8lOtgKO > > > > > to the iframe disappearing entirely ... > > > > >http://screencast.com/t/jCTjOLhpeX > > > > > I put your code in a $(document).ready() block (below). Are there any > > > > other modifications I should make to get it to display at 100%? > > > > > $(document).ready(function() { > > > > $('#fileTreeIframe').load( function() { > > > > var $ifbody = $(this).contents().find > > > > ( 'body' ); > > > > $ifbody.css( 'height','auto' ); > > > > $(this).height( $ifbody.height() ); > > > > }); > > > > }); > > > > > Thanks, - Dave- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
Hi Kevin, I really appreciate your help with all this. Unfortunately, I added what you had suggested ... $(document).ready(function() { $("body").layout({ closable: false , resizable: false , spacing_open: 0 , center_paneSelector: "#fileTreeIframe" }); }); and even included the normal script instaed of the .min.js file ... but sadly still now luck (screen shot is as before). There are no JS errors on the page. Do I have to give every element on my page a class name like you mention above, or should it be enough to only name the iframe? Thanks, - Dave On Jan 28, 10:11 am, Kevin Dalman wrote: > HI Dave, > > You can find all the info in the Layout documentation and examples, > but here is a quick answer... > > The widget needs to 'find' the iframe. The default method is to give > the element a ui-layout class, like this... > > > > OR, since the iframe has an ID, you can tell the widget to use that... > > > $(document).ready(function() { > $("body").layout({ > closable: false > , resizable: false > , spacing_open: 0 > , center_paneSelector: "#fileTreeIframe" > });}); > > > > /Kevin > > On Jan 27, 8:35 am, "laredotorn...@zipmail.com" > > > > wrote: > > Hi Kevin, > > > How do I apply this expansion to the iframe specifically? I included > > this on my page ... > > > </ > > script> > > <script type="text/javascript"> > > $(document).ready(function() { > > $("body").layout({ > > closable: false > > , resizable: false > > , spacing_open: 0 > > }); > > }); > > > > > src="file_tree.php" border="0" width="100%" scroll="auto"> > > > but still no love! ...http://screencast.com/t/aJxegNZmv > > > - Dave > > > On Jan 26, 12:27 pm, Kevin Dalman wrote: > > > > Hi Dave, > > > > This plugin may be more than you need, but... > > > > The UI/Layout widget will automatically position and size an iframe > > > (or other element) to fill the entire page, OR allow for a header, > > > footer, or sidebars. The code and markup are dead-simple. Here is an > > > example with a page-banner and an iframe. Everything is done for you, > > > including eliminating the 'body scrollbar'... > > > > $(document).ready(function(){ > > > $("body").layout({ > > > closable: false > > > , resizable: false > > > , spacing_open: 0 > > > }); > > > > }); > > > > [Banner here] > > > > > > > That's it! I recommend setting an iframe width & height for non- > > > Javascript browsers, but it's not necessary for Layout. Plus you must > > > set your preferred iframe options, like scrolling, border, padding, > > > etc. > > > > Plug-in website:http://layout.jquery-dev.net > > > > Simple iframe demo:http://layout.jquery-dev.net/demos/frames.html > > > > The Layout website itself used iframe pages with a 'banner', like: > > > >http://layout.jquery-dev.net/discuss.html > > > > Hope this helps. > > > > /Kevin > > > > On Jan 26, 6:55 am, "laredotorn...@zipmail.com" > > > > wrote: > > > > My iframe is also hard-coded. But here is what I get when I do > > > > console.log statements ... > > > > > $('#fileTreeIframe').load( function() { > > > > var $ifbody = $(this).contents().find > > > > ( 'body' ); > > > > console.log($ifbody); // Outputs > > > > Object length=1 0=body prevObject=Object jquery=1.2.6 > > > > $ifbody.css( 'height','auto' ); > > > > console.log($ifbody.height()); // > > > > Outputs 0 > > > > $(this).height( $ifbody.height() ); > > > > }); > > > > > Obviously the troubling thing here is that height is outputting zero. > > > > Can you provide the HTML that surrounds your hard-coded iframe? There > > > > must
[jQuery] Having trouble with contextMenu plugin in a frame
Hi, I'm using the context menu plugin from here -- http://www.trendskitchens.co.nz/jquery/contextmenu/. The problem I'm having is that when the functionality is in a frame, right clicking sometimes cuts off part of the menu -- http://screencast.com/t/Z9lGuq5X. I'm wondering if you know of a way to position the menu such that it's fully visible. Thanks for any help, - Dave
[jQuery] Simple way to check for duplicate menu values in jquery?
Hi, I have a number of select menus on my page, each containing the same list of options (values and text). What is the simplest way to check that a value in one select menu is unique? My goal is to verify that all menu values are unique. Thanks, - Dave