[jQuery] Re: jQuery problem with setTimeout()
Kali, since we're wondering if this is a jQuery problem, let's find out by taking jQuery out of the equation. Where the code uses jQuery to load the message into the #mailSuccess element, we'll just alert it instead - but we'll call alert in exactly the same way that you're calling jQuery now. First, I assume there's a typo or two in this code: function successHome(message) { setTimeout('$("#mailSuccess").html(message) 1000); and it actually reads: function successHome(message) { setTimeout('$("#mailSuccess").html(message)', 1000); } Correct? So let's change it to: function successHome(message) { setTimeout('alert(message)', 1000); } That doesn't work either, does it? This helps narrow it down: it's not a jQuery problem, so it must be a problem in this little bit of code itself. What's wrong? When you call setTimeout with a text string, that code gets executed *in the global scope*, i.e. just like code that is outside of any function at all. Your message variable is local to the successHome function, so code running in the global scope can't see it. Instead of passing a string to setTimeout, it's almost always better to pass a function. An inline anonymous function is often used: function successHome(message) { setTimeout( function() { alert(message); }, 1000 ); } Now the code will work as you expect, because the inner function has access to the variables of the outer function. Going back to the jQuery code, it would be: function successHome(message) { setTimeout( function() { $("#mailSuccess").html(message); }, 1000 ); } -Mike > From: kali > > I solved this, BUT: > > another weird problem: > > var message is passed to the function, so I have: > > function successHome(message) { > setTimeout('$("#mailSuccess").html(message) 1000); > > but it says 'message' is not defined > > only this works: > > function successHome(message) { > setTimeout('$("#mailSuccess").html("Your email has been > sent.Thank you.");', 1000); > > this is so bizarre > > if I do: > > function successHome(message) { > alert(message);// no probl here > //but here: > setTimeout('$("#mailSuccess").html(message);', 1000); > // it says 'message is not defined' > > > ??? > > thank you >
[jQuery] Re: jQuery problem with setTimeout()
I solved this, BUT: another weird problem: var message is passed to the function, so I have: function successHome(message) { setTimeout('$("#mailSuccess").html(message) 1000); but it says 'message' is not defined only this works: function successHome(message) { setTimeout('$("#mailSuccess").html("Your email has been sent.Thank you.");', 1000); this is so bizarre if I do: function successHome(message) { alert(message);// no probl here // but here: setTimeout('$("#mailSuccess").html(message);', 1000); // it says 'message is not defined' ??? thank you
[jQuery] jQuery problem with setTimeout()
var showDiv= $('#myDiv').html(message); setTimeout(showDiv,5000); get error: missing ] after element list I googled this error, it seems the problem is the jQuery code.. although not sure.. would appreciate some suggestions... thank you..
[jQuery] Hover elements in wrong state once page finishes loading
Sorry if this has been addressed before -- it's a hard issue to describe. The page in question: http://testing.ericprice.cc The code in question: $(document).ready(function() { $(".teaser").hover(function() { $(this).addClass("hovered").find(".thumbnail").stop(true, true).slideDown(100); }, function() { $(this).removeClass("hovered").find(".thumbnail").stop(true, true).slideUp(200); }); }); The problem: http://testing.ericprice.cc/problem.png What I'm seeing is that if you move your mouse around the thumbnails before all of the page elements finish loading (which you might have to do rather quickly if you have a fast connection), once the page finishes loading, some of them will suddenly appear in their "slid- down" state despite not being hovered over. This happens in both Safari and Firefox, and only seems to happen when I'm using the slideDown/slideUp effects -- hide/show doesn't cause the same issue. Any thoughts? I've already tried .mouseover/.mouseout and .bind instead of .hover, but to no avail.
[jQuery] [TreeView] - How to collapse a menu item that is a link?
Hi, I'm looking at the "JQuery TreeView - Sample 0" from http://jquery.bassistance.de/treeview/demo/?1 Great work! I have a question. How can I make the menu collapse upon clicking? When I click, the menu expands, but if I click again the menu doesn't collapse. Any help is appreciated. Thanks in advance
[jQuery] [TreeView] - How to collapse a menu item that is a link?
Hello, I'm looking at the Sample 0 from http://jquery.bassistance.de/treeview/demo/?1 Great work! I have a question. How can I make the menu collapse upon clicking? When I click, the menu expands, but if I click again the menu doesn't collapse. Any help is appreciated. Thanks in advance
[jQuery] Re: how to get onload listeners to work for dynamically loaded content
heres the answer to those of you seeking a way to have your event listeners work regardless as to how you add it to the dom, its really the icing on the cake for jquery - good job guys: as of 1.3: http://docs.jquery.com/Events/live#typefn use the 'live' event handler it is like bind however it will work on all future elements... this is great because my other solution was after php build my navigation based on data it gets from mysql, i was actually adding a
[jQuery] Swittching between innerfade slide shows
I have a page with links to a couple of slide shows implemented using the innerfade plugin. I prefer this plugin because it gives smoother transitions between images than I have been able to achieve using the cycle plugin. I would like to disable the innerfade when switching between slide shows. (I do not want to hide the div and have innerfade running burning up cpu cycles) The plugin does not provide a removeInnerfade function. Is there a way to remove innerfade from a div. Thanks, -john
[jQuery] Re: The jQuery Prototype Object and Working with Others' jQuery Plug-Ins
Hey guys, On the topic of namespacing, I have also found 'pollution' of the core a problem. I recently worked for a company that had over 30 plugins and I did run in to conflicting problems, especially with jQuery UI, which is one reason I stay away from it amongst others. If you are interested I've created a way to add namespacing to jQuery whilst still using 'this' as DOM array. Currently, it only goes 1 level deep, but I have found it extremely usefull. Instead of: $('div').dialog('open'); you could go: $('div').dialog().open(); Check the latest of this thread: http://groups.google.com/group/jquery-dev/browse_thread/thread/664cb89b43ccb92c -- Trey On May 8, 10:20 am, chris thatcher wrote: > blah my keyboard had is heavy and i hit send before i meant to. continuing > for roddy inline > > On Thu, May 7, 2009 at 8:06 PM, chris thatcher < > > > > thatcher.christop...@gmail.com> wrote: > > roddy, nice to meet you. reponse is inline > > > On Thu, May 7, 2009 at 7:31 PM, kiusau wrote: > > >> QUESTION ONE: When is use of the jQuery prototype object appropriate, > >> and when is it not? > > > i am not a jquery core or ui developer so this response must be taken with > > a grain of salt. > > > it is appropriate for the static jQuery namespace when the function is > > either 'generally useful' or 'highly reusable in instance context where the > > context is a dom node' > > > for the latter case ('highly reusable in instance context where the context > > is a dom node') i am way over-specific; however, the jquery core has > > basically cornered this market. the core dev team is highly aware of basic > > issues and most everything you could think of is already there. > > > 'polluting' the core namespace is the responsiblity of plugins. the term > > 'pollution' is used to mean only that every name you put on the namespace > > has the probability of conflicting in the future if it doesn't already > > exist. > > > if you make sure a name doesn't already exist on the jquery namespace, and > > if you think the new property (which may be a function, object, array, > > simple type, or a hetergeneous object/array/function jquery-like collection) > > is useful enough to be in the core library, please feel free to ask the > > jquery-dev list > > the chances are they will point to a thread that exists already and/or they > will question the concept by usually > 1) pointing to an existing solution > 2) providing context for why the question is still open > 3) ask you to create a ticket to fix it > 4) tell you it's a perfect use of the plug-in architecture an point you to a > great reernce for how to publish it correctly > > > > >> BACKGROUND: I am still trying very hard to identify the error that is > >> prohibiting me from incorporating a jQuery plug-in into my site in a > >> manner similar to the way that the author of the plug-in has > >> incorporated it into his. Although I have sought consultation with > >> the author, he appears uninterested in working with me. > > > post a link. you did below and i'm just about to look at it; however, it > > 'should' be the first thing you post. reduce the problem to a simple > example and post the url. the community will help you in most cases in just > a few minutes. on the other hand if you post something analogous to 'I > HAVE A MAJOR PROBLEM!!! CAN YOU HELP??? NOW!!! > 2...@#$%!#$%&%^%$$*$...@#%257 > > well chances are > > no > > the reason is we need you to help us help you. if you want the most basic > question answered please use this list: > jquery-ment...@googlegroups.com > > > > > > >> My still fledgling knowledge of jQuery tells me that the author of the > >> plug-in and my implementation of his plug-in are constructed > >> differently. Whereas I use jQuery's prototype property to reference > >> my method and then assign my method anonymously to my HTML document as > >> follows: $().myJQMethod(). The author of the plug-in does something > >> very different. > > >> Please compare the isolated code that I have extracted from the > >> author's plug-in and my implementation of it. Links to the source > >> pages have been included. > > >> CONSTRUCT A (The jQ_Impromptu Plug-In): > > >> (function($) { > >>$.prompt = function(message, options) { > >> })(jQuery); > > >> SOURCE: > >>http://homepage.mac.com/moogoonghwa/Imagine_Prototype/JavaScript/jQ_I... > > >> CONSTRUCT B (My implementation of the jQ_Impromptu Plug-In) > > >> (function($) { > >>$.fn.getBrowserInformation = function() { > >> })(jQuery); > > >> SOURCE: > >>http://homepage.mac.com/moogoonghwa/Imagine_Prototype/JavaScript/jQ_b... > > >> QUESTION TWO: Although I am able to implement the author's method, it > >> is not performing as it should. When the alert box appears with focus > >> the hosting HTML page is suppose to show through with dimmed opacity. > >> My implementation does not achieve this effect. Firebug has alerted > >> to me to the following breakpoint, but I am po
[jQuery] how to get onload listeners to work for dynamically loaded content
i am going to reword this question since no one seemed to be able to answer it last itme i asked. thanks in advance for any feedback. the problem i am having is with my event listeners that are initiated after document load, using jQuery(function() {}); the behviours do not work for dynamic html (loaded with post()) and added to the DOM using append() how do i make those listeners available to all html? thanks j
[jQuery] Re: AJAX issue
Hello guys and gals, would greatly appreciate it if anyone could help out with a problem I'm having while using FCKeditor?! Whenever I edit some content and submit it, it auto corrects stuff, i.e. image tags or adds these: \" into places. Creates loads of problems, nonetheless so if you would help out, that'd be great. Naz. On 9 May 2009, at 22:24, Mauricio (Maujor) Samy Silva wrote: -Mensagem Original- De: "Connor" ... How would I go about targeting the p tag or the content inside? --- Try: $(xml).find('content:encoded').each(function(){ var text = $(this).text(); Maurício
[jQuery] Re: AJAX issue
-Mensagem Original- De: "Connor" ... How would I go about targeting the p tag or the content inside? --- Try: $(xml).find('content:encoded').each(function(){ var text = $(this).text(); Maurício
[jQuery] JQuery TreeView Plugin Problem: Text Alignment in IE
Hello, I am currently using the treeview plug in at http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ Is is a nice work, and I am really pleased with it. I, however, have a problem of text alignment with the tree lines when I combined the treeview with the tabview in the jquery-ui library. There is no problem with other browsers (tested with Chrome, Firefox, Opera). The output is worst than what you will see in this online sample http://www.devshed.com/c/a/JavaScript/Opened-and-Closed-Branches-on-a-TreeView-jQuery-Hierarchical-Navigation-System/3/ which is not the way the main demo appears: http://jquery.bassistance.de/treeview/demo/ Please help. Best regards, Paul.
[jQuery] Re: Dynamic underlining for links on a page
On Sat, May 9, 2009 at 4:41 AM, naz wrote: > > Hello all, probably a simple question but I can't for the life of me > figure out how to do this: > > I have a page that has information on various # anchors, a list of > them are at the top and once clicked I need the one clicked to become > underlined and remain underlined untiled a different # is clicked. > > How on earth do I do this? I've managed to use jquery toggle to turn > on an underline once it is clicked, but i have to click the same link > again to turn it off, which is not what I want, I need it to > automatically turn off once a different link is clicked! assume they all have a class of "myAnchor" $('.myAnchor').click(function() { $('.myAnchor').css('text-decoration', 'none'); $(this).css('text-decoration','underline'); }); -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Superfish - only hide one level - how to?
Simplest solution would be don't use the third level UL's, add custom classes to the 3a and 3b you are showing and use css to customize. Won't be fighting script or having to change absolutely positioned subs that way webhank wrote: i am looking for a way to have superfish only hide the secondary navigation but not other levels - for example i have a horizontal nav bar with my primary navigation on it - i would like for the secondary AND tertiary navigation to show when i mouseover a main nav element. is there any way to show the 3rd level nav inline? level one a | level one b | level one c level 2 a level 2 b level 3a level 3 b level 2 c level 2 d etc...
[jQuery] Re: Problem with jQuery in Firefox
Hi Matt, thanks for the response, but actually this was already clear for me ;). Most importantly I need a workaround for it. I already tried the following too: var plan_price = obj.find("input[name='plan_price']:radio"); plan_price.each(function() { $(this).click(); }); and there is no change. The error is thrown in the obj.find("input [name='plan_price']:radio") statement. I tried changing to obj.children ("input[name='plan_price']:radio") gives no result. On 8 Май, 20:39, Matt Critchlow wrote: > obj.find("input[name='plan_price']:radio").click(); //is creating the > recursive loop > > On May 8, 12:59 am, MC Lueppers wrote: > > > Hi, > > > I'm in a development phase of a file sharing portal and I have a > > problem with jQuery on the following > > page:http://share.home.hive-net.net/pricing. In Firefox I get an error "too > > many recursion" when changing the plans. Can you please help me get > > rid of it? > > > Thanks in advance, > > Martin
[jQuery] Re: “Superfish” Vertical
add the superfish-vertical.css file to page along with the superfish.css, and in tag ul class="sf-menu" put class="sf-menu sf-vertical". Done, menu now vertical Englesos wrote: Hi All, I have been trying to talk “Superfish” into working as a vertical menu for phpWebsite (as discussed here) but whatever I do it insists on staying horizontal. I looked at the example at http://users.tpg.com.au/j_birch/plugins/superfish/#sample3 but I don't understand "add the class sf-vertical to the parent ul along with the usual sf-menu class," I design but I don't code :-) Could you please clarify as the example code on the page - for me - still produces a horizontal menu. Many thanks Englesos
[jQuery] AJAX issue
Hi, I've been experimenting with jQuery's AJAX capabilities. I was trying to create an effect that pulls data from an XML RSS feed and displays it. Long story short, I got everything to work, but I couldn't figure out how to pull data from a CDATA section like the following: I wanted to put the "Some Text" in a variable. But I have no clue how. This is what my jquery looks like so far: $.ajax({ type: "GET", url: "vid.xml", dataType: "xml", success: function(xml) { $(xml).find('item').each(function(){ var text = $(this).children("content").text(); }); //close each( } }); //close $.ajax( How would I go about targeting the p tag or the content inside? Thanks for any help, Connor
[jQuery] Re: jQuery Form FileUpload issue
> However, I think it could be a good idea if the plugin would force > using an iframe when the encoding is "multipart/form-data", even if > the file input is empty. I'm reluctant to make this change as it would probably catch a lot of people off guard. The plugin has always been this way so changing it now could introduce a lot of confusion. However, you can force this behavior by setting the 'iframe' option to true. Mike
[jQuery] Dynamic underlining for links on a page
Hello all, probably a simple question but I can't for the life of me figure out how to do this: I have a page that has information on various # anchors, a list of them are at the top and once clicked I need the one clicked to become underlined and remain underlined untiled a different # is clicked. How on earth do I do this? I've managed to use jquery toggle to turn on an underline once it is clicked, but i have to click the same link again to turn it off, which is not what I want, I need it to automatically turn off once a different link is clicked! Thanks in advance guys and gals. Naz. http://nazimjamil.com http://twitter.com/_naz
[jQuery] Complete frustration
Ok, all Im trying to do is a simple jquery post. Here is the code. function SubmitForm(method) { var login = document.form.login.value; var password = document.form.password.value; try { $.post("../../content/jaxrep.php", { login: login,password: password,method: method}); } catch(e) { alert(e); } return false } But it always fails at a line in jquery with the following code... // Send the data try { xhr.send(s.data); } catch(e) { jQuery.handleError(s, xhr, null, e); } If I use different versions of jquery I get a different line number for the error but it is always the same code. I have another page on the server which uses the same function yet it is fine, damned if I can see what the difference is. Anyone have any good methods to find out what is going wrong? Cheers
[jQuery] Best practice for using JQuery within another custom library
All, I’d like to use JQuery internally to a library I’m writing for a client of mine. My specialized library will be solely based on their REST services. I’d like to use JQuery’s AJAX functionality but I don’t want to cause any conflicts if the consuming developer is using JQuery on their main page. Is there a best practice or example of how to include or wrap JQuery in a custom library so it’s not exposed to the developers using my library? Maybe some type of encapsulation? Thanks, Coop
[jQuery] Problem creating own parser and setting a column to use it via metadata
Hi, I've created a parser and i know that it works properly, because if i set a column to it in the tablesorter initialization works fine. Next is the code: $.tablesorter.addParser({ id: 'price', is: function(s) { return false }, format: function(s) { var number = Number(s.toLowerCase().replace(/^([0-9]+\. [0-9]{2}).*/, "$1")); if (isNaN(number)) { number = Infinity; } return number; }, type: 'numeric' }); The problem is that i need to set it using metadata, but if i write it uses the usual text sorter instead of mine. What I'm doing wrong? Thank you so much!
[jQuery] Elements to inherit UI theme colors
I want to use UI theme colors on other elements of my pages and for them to switch automatically when UI theme is changed. I was going through css files generated by theme-rollerand didn't find any classes just for defining colors or borders used in a theme. For starters I wanted my form fields to have borders similar to UI theme. I used "ui-widget-content" and it worked fairly well, but I was wondering if there is a better way to do this.
[jQuery] “Superfish” Vertical
Hi All, I have been trying to talk “Superfish” into working as a vertical menu for phpWebsite (as discussed here) but whatever I do it insists on staying horizontal. I looked at the example at http://users.tpg.com.au/j_birch/plugins/superfish/#sample3 but I don't understand "add the class sf-vertical to the parent ul along with the usual sf-menu class," I design but I don't code :-) Could you please clarify as the example code on the page - for me - still produces a horizontal menu. Many thanks Englesos
[jQuery] Re: Problem with keyup event from Learning jQuery 1.3
Hi dude, event.keyCode is exclusive for IE in FF you use event.which var charCode = (evt.which) ? evt.which : evt.keyCode switch (String.fromCharCode(chadCode)) { rest of code
[jQuery] Selction Error
Hi folks, I want to select each row in a table. I am using a each iterator. I want to differentiate the rows containing tag and others. How can i do that Note: i want to select each rows. Appreciate each help
[jQuery] Clone div, it's child elements and increment name values.
Hi everybody, this task is very complicated to me, I hope to be as clear as possible so apologize for confusion. I've got this piece of code which is part of a form N. Select Number 1 2 3 Option Type Select Type Select One Option 1 Option 2 Option 3 I have to post this form to a php script in order to insert the values into a mysql database. The user has a button to duplicate this div and obtain a new one to specify more combinations. The problem is to clone and increment the "array" like this N. Select Number 1 2 3 Option Type Select Type Option 1 Option 2 Option 3 where the two select option_number[0] and option_type[0] become option_number[1] and option_type[1] and can be passed as unique fields. I've tried with jquery clone but I get identical divs with identical select names, so only the very first one is passed to the script and inserted in the db. Hope somebody can give a hand. Thanks.
[jQuery] Re: jQuery.form bug in FF with action='#anchor'
This should be fixed in v2.27: http://www.malsup.com/jquery/form/jquery.form.js?2.27 I also added some unit tests to verify the various action possibilities: http://www.malsup.com/jquery/form/test/ Mike On May 8, 1:40 pm, Cédric wrote: > Hi, > > after upgrading jQuery.form plugin from version 2.12 (06/07/2008) to > version 2.25 (08-APR-2009) > i encounter failure in Firefox 3.0.10 with ajax forms that had only an > anchor in action attribute of form, such as : > > > > This was perfectly working with version 2.12 of jQuery.form plugin but > does not work any more with version 2.25. > > The folowing patch seems to solve the > troublehttp://trac.rezo.net/trac/spip/changeset/13968 > > Cédric
[jQuery] Re: Tabs Custom HTML
Not really. You have to meet only one condition - the list to tabify has to be nested in a container. You can then put your panels whereever you want. Of course you can't ask for Themeroller support in that case. --Klaus On 9 Mai, 17:31, "kim...@gmail.com" wrote: > Hi everyone, > > With the latest UI release custom html structure for tabs plugin seems > to be unsupported, can you confirm this? > > Thanks.
[jQuery] Re: [Validation] Email
Sure, thats just as valid as em...@example.co.uk is. Jörn On Fri, May 8, 2009 at 8:57 PM, Brett wrote: > > I noticed that if you do the email: true in the validation and then > try and type an email such as: > > em...@example.com.com > > it will mark it as valid. Is this intended? > > > Even says its valid on your test page at: > http://docs.jquery.com/Plugins/Validation/Methods/email >
[jQuery] Tabs Custom HTML
Hi everyone, With the latest UI release custom html structure for tabs plugin seems to be unsupported, can you confirm this? Thanks.
[jQuery] Re: jQuery cluetip plugin
Hello Karl, I sent you a login to my beta site. I am not sure if you had a chance to look at it yet? Thanks. Bharat
[jQuery] Re: Problem with float:left; on i in multiple sortable lists
Sorry - typo. Height/min-heigh was the solution. K Den 9. mai. 2009 kl. 13.30 skrev krreks: Figured it out and thought that I'll share the solution with the world. Setting a width/min-width did the trick. Cheers krreks wrote: I'm working on an article module and have stumbled upon a problem. I'm having several connected lists and need to float the li elements in two of the three connected lists. I'm able to reoder the lists internally, and to move elements from the lists with floated li's to a list where the elements are not floated, but not into a list with floating li's. -- View this message in context: http://www.nabble.com/Problem-with-float%3Aleft--on-i-in-multiple-sortable-lists-tp23448937s27240p23459684.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Problem with float:left; on i in multiple sortable lists
Figured it out and thought that I'll share the solution with the world. Setting a width/min-width did the trick. Cheers krreks wrote: > > I'm working on an article module and have stumbled upon a problem. I'm > having several connected lists and need to float the li elements in two of > the three connected lists. I'm able to reoder the lists internally, and to > move elements from the lists with floated li's to a list where the > elements are not floated, but not into a list with floating li's. > -- View this message in context: http://www.nabble.com/Problem-with-float%3Aleft--on-i-in-multiple-sortable-lists-tp23448937s27240p23459684.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Changing droppable accept or scope dynamically in the "drag" callback.
I've tried about everything and can't get the results I need. Basically I have some draggables in a movable div (pane). When I'm over the pane I only want the draggable to be droppable on elements in the pane (and have a visual cue as such). When I move beyond the pane I only want the draggable to be droppable on elements on a background div the size of the window behind the pane. Right now if I drop on a droppable in the pane and there is a droppable behind the pane they both get the drop call. I'm setting up the droppables in the "start" callback of the draggable. I've tried changing the accept on the droppables outside the pane in the "drag" callback, when the draggable crosses outside the pane boundary. I can't seem to change the accept on droppables dynamically from within the drag callback. They seem locked to the state when the drag first started. I've also tried changing the scope of the draggable (and also tried it on the droppables) from within the "drag" callback, when the draggable crosses outside the pane boundary. The scope doesn't seem to change dynamically when called from within the "drag" callback. They also seem locked to the state when the drag first started. I would really like the activeClass cue to change dynamically when I cross the pane boundary as well. Does anyone have any ideas as to how to make this work. Thanks, -ml