[jQuery] Re: Does it hurt to call functions that don't do anything on the page?
Thanks for the ideas everyone! @Stephan: Yes, it's in an external JS file. I'd prefer to not have to do any inline javascript. I've considered it, but thanks for the suggestion! @Ricardo: Thanks for those. I may end up doing a variation of them. On Feb 8, 4:50 am, Stephan Veigl stephan.ve...@gmail.com wrote: Hi I guess you have your $().ready() function in an external js file, otherwise you could customize it for the according html page. Another construct similar to Ricardos one, but a bit more flexible: Use a global variable in every html file to specify the init functions you want to call for this page: script type=text/javascript myInitFxn = [ManageCategoriesClick, HideByDefault, PrepareSplitForm,...]; /script ready.js: $().ready(function(){ for(var i in myInitFxn) { myInitFxn[i](); // call init function } }); by(e) Stephan 2009/2/8 brian bally.z...@gmail.com: On Sat, Feb 7, 2009 at 11:21 PM, Ricardo Tomasi ricardob...@gmail.com wrote: Alternatively you could add a different class to the body of each page, then use this rather amusing construct: $(document).ready((function(){ var is = function(v){ return ++document.body.className.indexOf(v) }; return( is('categories') ? ManageCategoriesClick : is('hidebydefault') ? HideByDefault : is('form') ? PrepareSplitForm : is('advert') ? SetUpAdvertPopup : function(){} //nothing ); })()); That is, indeed, amusing. And one for my toy chest. Thanks! Who knew, back in '96, that javascript was going to turn out to be so much fun?
[jQuery] Does it hurt to call functions that don't do anything on the page?
So I have my document.ready function, looks something like this: $(document).ready(function(){ ManageCategoriesClick(); HideByDefault(); PrepareSplitForm(); SetUpAdvertPopup(); CheckAll(); CheckNone(); EditCategoryInPlace(); PreparePaneLinks(); PrepareToolTips(); }); Those functions all call things, but many are for specific pages. Does it slow the page down if they don't find the elements the functions call? What's the best way to call functions that are specific to a single page? -beau
[jQuery] Hide / Show a panel in an acordion
Hi Everyone, I have been searching through the archive for the past two hours and also had a chat with everyone's good friend - Mr.Google. I have also been checking out just about every accordion plug-in home page / demos - but haven't found what I am looking for, thus my email here. Anyway - what I need for an application is the ability to hide and show an accordion panel, based on input from some other panel in the same accordion. I.e. if the accordion has 4 panels - and the last panel contains a button that allows a user to submit the details they have provided in the previous panels,. What I would like to do is have the last save panel hidden until all mandatory fields in the previous panels have been entered - and then show the save panel at that time. Oh and if it helps any I have been using Jorn's Accordion plug-in. Thanks in advance or any information you might be able to send my way! -Beau.
[jQuery] Re: Superfish, IE Problems
Thanks for the suggestions, I'll give them a try! --Beau On Nov 28, 5:14 pm, cromeis [EMAIL PROTECTED] wrote: Anyway, I've got the menus working the way I want in Firefox, but can't get them to work quite as well in IE 6 7. The two problems I'm facing in IE 6/7 is that the third level menus are either too far to the left or right. Also in IE 7 the hover (darker green) extends past the menus (too far to the right). Hi Beau, I think it has to do with your padding on the below element. IE calculates width and padding differently from other browsers, in your case firefox adds the padding to the overall width of this element where IE doesn't, resulting in different overall width and also effecting how far over you need to set your next level of navigation. You could try using an IE hack for the width ( *html .nav li li a {width: 180px;}) (though not the best option, I'll admit it) or maybe try using margin for the width instead... i wasn't able to try that so I'm not sure if it would work. You also need to make sure that all of your left positioning is what you want, some of them are 160px and some are 180px... .nav li li a { float:none; font-size:12px; line-height:13px; padding:5px 10px; width:160px; } I hope this helps! - carleigh
[jQuery] Superfish, IE Problems
First off I do have to say thanks for the great menu plugin, its saved a lot of time. Anyway, I've got the menus working the way I want in Firefox, but can't get them to work quite as well in IE 6 7. The two problems I'm facing in IE 6/7 is that the third level menus are either too far to the left or right. Also in IE 7 the hover (darker green) extends past the menus (too far to the right). You can see what I've got so far at http://www.mjonline.com/beta/ Any help or suggestions would be much appreciated. Thanks, Beau
[jQuery] Form Variables
Hi Everyone, I have a pretty weird issue that I am unable to solve myself. I am using jQuery and ColdFusion. The issue is that for some unknown reason, that when I submit a form, the form variable that has been jquerified is not submitted - it is not part of the form scope. I have created a small test coldfusion form/page and can successfully jquery touched fileds without error. So I am confident it is not a coldfusion form / JS issue. Yet when I try to insert the EXACT same code into an exisiting form the form variable is lost. Would anyone have any ideas that I could investigate? Thanks in advance for anything you might be able to suggest. Beau