[jQuery] Re: link fade in / out
*bump* On 11 Nov, 19:15, Althalos [EMAIL PROTECTED] wrote: Hi. I have a menu consisting of some simple text links. They start with an opacity of 0.33 then when I move my mouse over them they lit up. They worked well, however the effects wanted to stack up in a queue so that when I had swept my mouse over the links a couple of times fast they would keep fading in and fading out as many times as I had swept my mouse over them. What I want is a link that lights up when you move the mouse across it, then fades down and keeps faded out until I sweep my mouse over it again. So I added .stop, which didn't work to well. I was hoping someone would correct me. What happens right now is that sometimes (often) links get stopped in the middle, with an opacity which is neither 0.33 nor 1. Also some links freeze and don't respond to moue hover... thank you. $(a).hover(function(){ $(this).fadeTo(500,1); }, function() { $(this).fadeTo(300,0.33, function () { $(this).stop({gotoEnd:true}); }); });
[jQuery] Re: document Ready function in the Ajax Response
Sorry for the last reply.. Example below, when run FF3 will alert message In Index will only appear and on IE7 will alert In Index and also In Ajax Response code. index.jsp html head script type=text/javascript src=/framework/jquery/ jquery-1.2.6.js/script script type=text/javascript $(document).ready(function() { alert(In Index); $.ajax({ url: ajaxResponse.jsp, success:function(response, textStatus){ $('#xyz').append (response);} }); }); /script /head body div id=xyz / /body /html ajaxResponse.jsp html head /head script type=text/javascript src=/framework/jquery/ jquery-1.2.6.js/script body script $(function() { alert(In Ajax Response); }); /script /body /html On Nov 11, 4:58 pm, Alexandre Plennevaux [EMAIL PROTECTED] wrote: instead of loading script, use the livequery plugin: http://brandonaaron.net/docs/livequery/ On Tue, Nov 11, 2008 at 12:54 PM, David Wu [EMAIL PROTECTED] wrote: could you pose some of your code? On Tue, Nov 11, 2008 at 6:30 PM,ravithokala[EMAIL PROTECTED] wrote: Hi, I have an issue with document.ready. I have a page which will make an ajax call. The response on the ajax call contains script which contains document.ready. The content in document.ready is getting executed successfully in ie7 but not in ff3. Please tell how to solve this in FF.
[jQuery] Re: jeditable autocomplete - time to revisit?
On Nov 12, 2008, at 1:46 AM, [EMAIL PROTECTED] wrote: I was wondering if it my be possible to add autocomplete functionality using the addInputType API. It looks like it might be possible to attach autocomplete to the text input through the element: argument when declaring a custom input type. It should be fairly easy. Usually you just to need to create the element using element and add plugin to it using plugin. Check for example these custom inputs: http://github.com/tuupola/jquery_jeditable_markitup/tree/master/jquery.jeditable.markitup.js http://github.com/tuupola/jquery_jeditable/tree/master/jquery.jeditable.autogrow.js http://github.com/tuupola/jquery_jeditable/tree/master/jquery.jeditable.charcounter.js http://github.com/tuupola/jquery_jeditable/tree/master/jquery.jeditable.masked.js I can give autocomplete a try later today if I have time. -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Re: link fade in / out
not entirely sure if it will work this way but try $(a).bind(mouseenter,function(){ $(this).fadeTo(500,1); } }); $(a).bind(mouseenter,function() { $(this).fadeTo(300,0.33); }); Althalos wrote: *bump* On 11 Nov, 19:15, Althalos [EMAIL PROTECTED] wrote: Hi. I have a menu consisting of some simple text links. They start with an opacity of 0.33 then when I move my mouse over them they lit up. They worked well, however the effects wanted to stack up in a queue so that when I had swept my mouse over the links a couple of times fast they would keep fading in and fading out as many times as I had swept my mouse over them. What I want is a link that lights up when you move the mouse across it, then fades down and keeps faded out until I sweep my mouse over it again. So I added .stop, which didn't work to well. I was hoping someone would correct me. What happens right now is that sometimes (often) links get stopped in the middle, with an opacity which is neither 0.33 nor 1. Also some links freeze and don't respond to moue hover... thank you. $(a).hover(function(){ $(this).fadeTo(500,1); }, function() { $(this).fadeTo(300,0.33, function () { $(this).stop({gotoEnd:true}); }); });
[jQuery] Re: link fade in / out
not entirely sure if it will work this way but try $(a).bind(mouseenter,function(){ $(this).fadeTo(500,1); } }); $(a).bind(mouseleave,function() { $(this).fadeTo(300,0.33); }); Althalos wrote: *bump* On 11 Nov, 19:15, Althalos [EMAIL PROTECTED] wrote: Hi. I have a menu consisting of some simple text links. They start with an opacity of 0.33 then when I move my mouse over them they lit up. They worked well, however the effects wanted to stack up in a queue so that when I had swept my mouse over the links a couple of times fast they would keep fading in and fading out as many times as I had swept my mouse over them. What I want is a link that lights up when you move the mouse across it, then fades down and keeps faded out until I sweep my mouse over it again. So I added .stop, which didn't work to well. I was hoping someone would correct me. What happens right now is that sometimes (often) links get stopped in the middle, with an opacity which is neither 0.33 nor 1. Also some links freeze and don't respond to moue hover... thank you. $(a).hover(function(){ $(this).fadeTo(500,1); }, function() { $(this).fadeTo(300,0.33, function () { $(this).stop({gotoEnd:true}); }); });
[jQuery] New plugin: IFRAME event propagation
Hello, I've added a plugin for event propagation for IFRAMEs. I wrote this to propagate onresize events to all IFRAMEs because I've noticed that certain browsers don't do this reliably (e.g. IE6 has some bizarre optimization that prevents the IFRAME from getting the resize event in certain circumstances). Also, in standards mode, IE won't send resize events to IFRAMEs unless the content is fully expanded 100% to the edge of the browser. In any case, this plugin can be used to forward any event or custom event to iframes in a jQuery way: $(iframe).framecontext().propagate(frameresize); Here's the link: http://plugins.jquery.com/project/iframeprop Comments welcome. Regards, - Mike Oliver
[jQuery] feature request: optionally use createElementNS
I've been playing with writing XUL desktop apps. Currently building my own custom media center PC and a XUL app will be the core of it. So I thought it would be really cool if I could use JQuery to manipulate my hybrid XUL / SVG / HTML doc just as I do on the websites I maintain. I include jquery-1.2.6.js, and many functions work fine immediately. However, a big chunk of JQuery doesn't work. Namely, code that inserts elements into the DOM fails. So I go through and change all the createElement calls in jquery-1.2.6.js to use createElementNS with the namespace http:// www.w3.org/1999/xhtml. Bingo! It now works perfectly! I have the full JQuery goodness over SVG elements, XUL elements, HTML elements. Coding just got a lot easier. But I would love it if I could somehow tell JQuery use createElementNS and the following namespace when creating elements. With this, I would not have to hack the JQuery core to get my app working. Cheers, --fletch
[jQuery] Newbie Question: DropUP menus
I'm working on a website at http://beta.ponderosatreeservice.com (excuse the dust). As you can see I have a series of tabs at the bottom of the large image. Instead of a traditional menu that drops down below the tab I'd like it to extend up with the original tab header still at that top. I've uploaded an example of what I want it to look like at http://beta.ponderosatreeservice.com/images/dropdownexample.jpg Is there any jQuery script I can use to accomplish this?
[jQuery] cloneinf TR with event
I have a working solution to this but can't help thinking I am missing an easier way. I have a table that is prepoulated server side and the user has the ability to add a row. one of the inputs has a function bound to the keyup event. wether I clone(true) or clone() the attribute fonkeyup seems to be clones, so I need to remove it and then bind another. my code is below, olease could someone look and see if there is an easy/ better way to do this/ thanks P $(#AddElement).click(function() { var clone = $(#CostRow\\[0\\]).clone(true); $(clone).find(input).each(function() { var s = $(this).attr(id); s = s.replace(0, costscount); $(this).attr(name, s); $(this).attr(id, s); $(this).attr(value, '0'); }); $(clone).find(#costs\\.Index).val(costscount); $(clone).find(#costs\\[ + costscount + \\]\\.GrossCost).attr (onkeyup,); $(clone).find(#costs\\[ + costscount + \\]\\.GrossCost).bind (keyup,function() {Add(costscount);}); costscount++; $(#CostTable).append(clone); $(#CostTable tr:even).addClass(even); return false; });
[jQuery] Re: conditional remote validation
How and where do you decide what is valid? Either do it on the serverside, in which case you don't have to modify the clientside logic. Or on the clientside, in this case a custom method that returns (instead of the usual true/false) just a string dependency-mismatch. That cancels all further validation for that field (same as required dependencies). Jörn On Tue, Nov 11, 2008 at 10:21 PM, spellingcity [EMAIL PROTECTED] wrote: There is a particular scenario where I don't want the remote validation to actually get executed. In particular, this is when you have a field, say a username field and the user is editing the field and the value of the field is their current username. This is considered a valid username and remote check shouldn't execute. Any suggestions? Thanks
[jQuery] [Superfish] Third horizontal navigation?
... On 12 Nov., 14:04, Klaus Hartl [EMAIL PROTECTED] wrote: Please avoid killing someone else's thread by changing the subject. How to unsubscribe:http://groups.google.com/support/bin/answer.py?answer=46608src=top5;... --Klaus On 12 Nov., 11:36, SEAN CLIFFORD [EMAIL PROTECTED] wrote: unsubscribe _ Get 30 Free Emoticons for your Windows Live Messengerhttp://www.livemessenger-emoticons.com/funfamily/en-ie/
[jQuery] [autocomplete] positioning of select box
Hi all, I am new to this message group. I am using the autocomplete plugin successfully but have a little problem with the absolute positioning of the select box. The select box automatically positions to the bottom of the input field. But in my case the borders of the input field is set to invisible, and I have a border image around the input field (which is slightly larger than the original border). The select box appears too high. How can I tell the select box to appear below the image-border?
[jQuery] Re: [Superfish] Third horizontal navigation?
kidhermes wrote: Hello I've try to put a third horizontal navigation with Superfish instead vertical. How I can do that easly? Is that possible? Thx for yoru feedback. Dom So, I hope my request are still active. Any idea? Dominique -- View this message in context: http://www.nabble.com/-Superfish--Third-horizontal-navigation--tp20457772s27240p20460877.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: [Superfish] Third horizontal navigation?
I've never used superfish but I'm guessing it would be css changes, probably float:left on the the li tag the some widths, padding etc. kidhermes wrote: kidhermes wrote: Hello I've try to put a third horizontal navigation with Superfish instead vertical. How I can do that easly? Is that possible? Thx for yoru feedback. Dom So, I hope my request are still active. Any idea? Dominique
[jQuery] Re: [Superfish] Third horizontal navigation?
I don't have an example to point you to, but it is definitely possible. How easy it is will depend on your CSS skills though. I guess you should start with the version that has the third tier vertical, and adjust that third tier to be more like the second. Joel.
[jQuery] Adjusting the position and offset of the text
I didn't notice this right away. I thought it would be in the css but that's not the case. I've created my own images for the background and I need to adjust where the text starts and an offset for the right side (padding) as well. next, In order to use this multiple times on one page you must create new instances each time. I'm using this all over my site, so the first line is getting long. Is there a better, more efficient way to do this? $(#fancy, #fancy2, #fancy3, #green, #registration, #list, #tablecycle).tooltip({
[jQuery] Re: jeditable autocomplete - time to revisit?
On Nov 12, 2008, at 10:28 AM, Mika Tuupola wrote: On Nov 12, 2008, at 1:46 AM, [EMAIL PROTECTED] wrote: I was wondering if it my be possible to add autocomplete functionality using the addInputType API. It looks like it might be possible to attach autocomplete to the text input through the element: argument when declaring a custom input type. It should be fairly easy. Usually you just to need to create the element using element and add plugin to it using plugin. It is basically 5 lines of code. Quick and dirty autocomplete input for Jeditable: -cut- $.editable.addInputType('autocomplete', { element : $.editable.types.text.element, plugin : function(settings, original) { $('input', this).autocomplete(settings.autocomplete.data); } }); -cut- Then you can call it with something like: -cut- $(.autocomplete).editable(http://www.example.com/save.php;, { type : autocomplete, tooltip : Click to edit..., onblur: submit, autocomplete : { data : [Aberdeen, Ada, Adamsville, Addyston, Adelphi, Adena, Adrian, Akron] } }); -cut- -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Re: problem in setting opacity
Not sure, but have you tried setting the opacity with jQuery? Something like this (after the line where you call the cluetip() method): $('#cluetip').css('opacity', '.7'); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 12, 2008, at 7:03 AM, Balu wrote: Hi I am trying to set the opacity of clue tip. I tried form css and browser. It is working, But it is hiding the rounded corners, arrows at the up side of the cluetip. I am using jQuery clueTip plugin Version 0.9.4 I am setting opacity in css as fiter: alpha(opacity=70) Please suggest me to resolve this problem. Thanks in Advance, Balu
[jQuery] Re: links going to top of page
Yes, the preventDefault() works just great, but only for a tags that are loaded with the page initially. When I load a sub-page within the div tags, that's where I'm having the problem. That sub-page does not respect the new a handler. I suspect it is because the new page is loaded after the original document.ready. Klaus Hartl-4 wrote: On 12 Nov., 00:15, Rik Lomas [EMAIL PROTECTED] wrote: On links, you need to return false as this is the default behaviour when a link is clicked e.preventDefault() should do the same... --Klaus -- View this message in context: http://www.nabble.com/links-going-to-%22top%22-of-page-tp20447058s27240p20462226.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: [autocomplete] - IE 6 and IE 7 Scroll bar problem.
Jorn, I have opened a ticket for the issue. Ticket #3563 http://ui.jquery.com/bugs/ticket/3563 Thanks! Akio On Nov 12, 3:07 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Thanks, now I can reproduce it. I indeed used the mousewheel to scroll, but it looks like the click is the important part. Could you file a ticket for this?http://ui.jquery.com/bugs/newticket (requires registration) Thanks! Jörn On Tue, Nov 11, 2008 at 7:26 PM, Akio [EMAIL PROTECTED] wrote: Jorn, Thank you for showing interest in my problem. It shows the problem on all inputs with a scroll bar. You can try it on Single City (local) or Single Bird (Remote) on http://jquery.bassistance.de/autocomplete/demo/. And the problem is exhibited on IE 7 as well. Here are the steps once again with more details. 1. Enter something in the text box that provides suggestions (You could try Single City (local) or Single Bird (Remote) and enter a) 2. Let the suggestion list appear with scroll bars. 3. Use the mouse button to scroll up or down (not the mouse wheel) by dragging the scroll bar (remember to use the mouse to scroll up and down. this step is very important. I think it moves the focus away from the text box field and this is probably the cause of the problem) 4. Now click on anywhere outside the suggestion list. Ideally the suggestion list should disappear but I see that the suggestion list just sits there unless you select something from the list At this point the keyboard Up and Down arrows also do not seem to work. Even the Esc key wont work. Thanks! Akio. On Nov 11, 9:33 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: I can't reproduce that. Which actual example (which input) did you test with? Jörn On Tue, Nov 11, 2008 at 3:31 PM, Akio [EMAIL PROTECTED] wrote: I have been looking at JQuery autocomplete and just when I thought it would meet my needs, I found a bug on IE 6. This is the problem. 1. Enter something in the text box that provides suggestions 2. Let the suggestion list appear with scroll bars. 3. Use the scroll bar to scroll down or up (this step is very important) 4. Now click on anywhere outside the suggestion list. Ideally the suggestion list should disappear but I see that the suggestion list just sits there unless you select something from the list At this point the keyboard Up and Down arrow also do not seem to work. It works fine on FF 3 and I think IE 7 (though I would need to re- test). I tested it on this linkhttp://jquery.bassistance.de/autocomplete/demo/ Any help would be appreciated. -Akio- Hide quoted text - - Show quoted text -
[jQuery] Re: can you simplify this selector? easy for you...
On Nov 12, 2008, at 9:05 AM, Rik Lomas wrote: This is completely untested, but this is a bit simpler: $('#PG1_L03-table').find('td:eq(3), td:eq(5), td:eq(7), td:eq(9)').find('input').bind.. That won't work, because it'll only select the 4th, 6th, 8th, and 10th TD. 2008/11/12 ggerri [EMAIL PROTECTED]: have the following selector and wonder how this could be simplified? :confused: $('#PG1_L03-table td:nth-child(3) input, #PG1_L03-table td:nth- child(5) input, #PG1_L03-table td:nth-child(7) input, #PG1_L03-table td:nth- child(9) input').bind.. need to bind an event to all input fields of col 3, 5, 7 and 9 but only for table PG1_L03-table. You could try this: $('#PG1_L03-table td:nth-child(2n+3)').bind ... That will also get cols 11, 13, etc., so if you need to stop at 9, let me know and I'll think about it some more. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: how to use another javascript funtion (and outside variables) inside jquery model
Thanks Mike and Ricardo, One of the things that Ricardo was right about was he used . rather than # and the reason why he did that was he declared 'links' as a class and not ID. Hope it make sense. And Mike I like your tricks on making hide me button works in that simple way. All cool. Just to share with you guys, I have managed to do it dynamically using php and mysql. That's probably not the best way but it is working fine. If you are interested to see the code I can put it up here. The logic is simple: for javascript and css parts you run a php script that retrives the id from the database and you use the id as the unique identifier. That does the trick. I'll write some php functions so that the code does look neater and cleaner than what it is now. Thanks, On 11 Nov, 21:09, Michael Geary [EMAIL PROTECTED] wrote: That looks like just whatOlineeds - thanks, Ricardo. The selector is not quite right in the click handler. Don't strip off the leading '#' character, because you would just have to add it back in to make a jQuery selector. Also, for efficiency, I would suggest using IDs instead of classnames for those contents and links elements. And don't forget to return false to suppress the standard link behavior. So your jQuery code in the document ready function would be: $(#links a').click( function() { var selector = $(this).attr('href'); $(selector).slideToggle(); return false; }); The only extra thing would be a way to make the hide me buttons work. One easy way to do that would be to use the same general technique. In the A tag for each hide me link, use the same coding for the href: #abstract etc. Also assign a specific classname to these A tags. For example: a href=#abstract class=hideme(img tag here)/a Then add to your jQuery setup code: $('#contents a.hideme').click( function() { var selector = $(this).attr('href'); $(selector).slideUp(); return false; }); -Mike From: ricardobeat The most clear way is to assign a single click handler: HTML: div class=contents div id=abstractBla bla bla bla /div div id=somethingelseBla bla bla bla /div /div ul class=links lia href=#abstractHow to write an Abstract/a/li lia href=#somethingelseHow to write something else/a/li /li And in the document's head: (hope google groups doesn't break it too much) script type=text/javascript $(document).ready(function(){ $('.links a').click(function(){ //get all a elements inside the element with class links var id = $(this).attr('href').substring(1); //get the content's id $(id).slideToggle(); //toggle visibility of the contents }); }); A glance at the docs (docs.jquery.com) should give you an insight of what's going on. As for the PHP, you can't actually pass a Javascript variable to it. PHP is parsed/executed server-side, way before javascript. To get data on-demand based on a javascript variable you need to use Ajax. (docs.jquery.com/Ajax) - ricardo /script On Nov 11, 5:01 pm,Oli[EMAIL PROTECTED] wrote: Thanks Mike for your reply. Okay, I have implemented this in a static mode: http://www.uniquebrand.co.uk/education/index.php Under Online resources if you click on these two links How to write an Abstract How to Write a Good Essay You will see the effect that I am trying to achieve. It does serve my purpose but the links and their IDs are not dynamically generated. I want to do the same kind of slide up and down for dynamically generated content. Does it explain my goal clearly? Sorry, I am not a native english speaker. So, apologies for any confusion. Many Thanks :) On Nov 11, 6:54 pm, Michael Geary [EMAIL PROTECTED] wrote: Could we back up a bit and have you describe very simply how you want this page to work? Leave out all of the implementation details like the IDs and the JavaScript code. Simple HTML is OK if that helps describe what you want. It looks like you're pretty far off track on the implementation (no offense intended! We'll help you get back on track), but it would be hard to suggest a better approach without understanding what this will look like to the visitor to your site and how they will interact with it. Thanks, -Mike From:Oli Hi guys, I am really excited about what I can do with JQuery, I just managed to finish one simple demo which basically allows a new css div to slide open when people click on a link. The initially technique was all fine except everything there is static. I then tried something dynamic where I got myself stuck. Let me explain a bit more, for each of the following hyperlinks I'd like to load the id from the database. So, they will look as follows: a href=# id=123
[jQuery] Character encoding problem when using ajax .load
Hi, I have a latin-1 encoded webpage that i'm loading text/html into using .load When i'm loading in english text everything is fine and dandy although today i had the pages translated and the pages now don't display the special characters properly. I'm pretty sure this has got to do with the fact that the text i'm passing to jquery is latin-1 not utf-8 so it screws up. Here's my js; jQuery(document).ready(function() { jQuery(.overview).click(function() { jQuery(#mainColumn).load(/includes/products/new-sea-page- overview.ssi); } ); }); I would just change the format of the file to utf-8 but i'm calling in the same file using a virtual include (just incase the user doesnt have javascript enabled) so it needs to be latin-1. I need to somehow keep the file as latin-1 but get jquery/javascript to understand it, either by encoding it as utf-8 (on the fly) or some other crazy means. I'd very much appreciate any help/advice. James
[jQuery] text-shadow
Hello, I have added a plugin for CSS-3 Text-Shadow for IE. It reads the value of text-shadow and gives IE an equivialant effect with the propertiary CSS Filter Blur. Simply write your CSS h1 { text-shadow: 2px 2px 2px #999; } And then apply the plugin $(h1).textShadow(); Here is the link for the plugin project http://plugins.jquery.com/project/textshadow/ And here is the link for the demo site http://www.hintzmann.dk/testcenter/js/jquery/textshadow/ Comments are welcome :D Best regards, - Martin Hintzmann
[jQuery] Tablesorter 2.0 widget Problem
Hi Guys, I'm trying Tablesorter 2.0 a little bit and using the Zebra Widget, which works great. Now I trying to modify the Widget a little bit. But my jQuery skills are bad - (rly bad). So the Zebra Widget changes the CSS-Classes for each row, it should do this to the last column too, but i dont get it working. Tried now some many variations, I post u my last here: Widget Code: ts.addWidget({ id: zebra, format: function(table) { if(table.config.debug) { var time = new Date(); } $(tr:visible,table.tBodies[0]) .filter(':even') .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]) .end().filter(':odd') .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]); $(tbody td:eq(.row1_icon),table.tBodies[0]) .removeClass(table.config.widgetZebra.css[1]+_icon).addClass(table.config.widgetZebra.css[0]+_icon); if(table.config.debug) { $.tablesorter.benchmark(Applying Zebra widget, time); } } }); Maybe some of you can give a little tip, hint or an example so that i can figure out, what to do? Thanks for reading. Regards -- View this message in context: http://www.nabble.com/Tablesorter-2.0-widget-Problem-tp20462157s27240p20462157.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] unsubscribe
unsubscribe _ Get 30 Free Emoticons for your Windows Live Messenger http://www.livemessenger-emoticons.com/funfamily/en-ie/
[jQuery] Re: links going to top of page
Yeah, it'll be due to the new a tags that are loaded into the page, there's more on this here: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F http://www.learningjquery.com/2008/05/working-with-events-part-2 2008/11/12 rpetras [EMAIL PROTECTED]: Yes, the preventDefault() works just great, but only for a tags that are loaded with the page initially. When I load a sub-page within the div tags, that's where I'm having the problem. That sub-page does not respect the new a handler. I suspect it is because the new page is loaded after the original document.ready. Klaus Hartl-4 wrote: On 12 Nov., 00:15, Rik Lomas [EMAIL PROTECTED] wrote: On links, you need to return false as this is the default behaviour when a link is clicked e.preventDefault() should do the same... --Klaus -- View this message in context: http://www.nabble.com/links-going-to-%22top%22-of-page-tp20447058s27240p20462226.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: fade a background color
jQuery might not be able to do classes, but it can do attributes. You can use a selector like $('#links [EMAIL PROTECTED]').fadeTo(slow, 0.1); On Oct 29, 8:24 pm, evanct [EMAIL PROTECTED] wrote: so i wanted to have some links in which the background color fades in and out on hover. thing is, though, i wanted to have the text of the links not fade - only the background-color. so i thought, okay, i'll just make three elements: a parent div, a child display:block link, and another child link, this one with a high z-index. this way i can fade the first child link, and since the second child has a high z-index, it will stay above the fade. so i do that: script type=text/javascript $(document).ready(function(){ $(.animate).fadeTo(slow, 0.1); $(.animate).hover(function(){ $(this).fadeTo(slow, 1.0); },function(){ $(this).fadeTo(slow, 0.1); }); }); /script body . div id=links a href=# class=animate/aa href=# class=secondLorem/a a href=# class=animate/aa href=# class=secondLorem/a a href=# class=animate/aa href=# class=secondLorem/a /div ... /body /html but then i realize that jquery can't do classes, only ids. and i can't do $(#links a).fadeTo(slow, 0.1); because that will fade both classes of links, when i only want the .animate links to fade. so, uh, anyone know of a way to fade only a background color/image without fading the text?
[jQuery] Re: jQuery Uploader Flash player 10 fix
No news are good news? ;)
[jQuery] Re: Tab divs disappear
I'm not sure what you mean, what initialization code should I use? I tried putting the AJAX options in there, but got the same result. On Nov 11, 3:48 pm, Klaus Hartl [EMAIL PROTECTED] wrote: And you're not using Ajax tabs? Rotate and Ajax together is not supported right now. --Klaus On 11 Nov., 20:39, aaron [EMAIL PROTECTED] wrote: $(function() { $('#tabs_container ul').tabs( {fx: { opacity: 'toggle' } }).tabs('rotate', 5000); }); On Nov 7, 4:20 pm, Klaus Hartl [EMAIL PROTECTED] wrote: On 7 Nov., 21:43, subnet_rx [EMAIL PROTECTED] wrote: I'm using jQuery UI tabs and I'm rotating them automatically. The problem is, for half a second, the div disappears till the next one loads. This modifies the size of the page and the page jumps around while this is going on. The divs only contain static content, and I've tried AJAX cache options, but they don't work. I just want them to fade out and fade in. What initialization code should I be using? What initialization code should do you use? --Klaus
[jQuery] Re: Event Capture Architecture
Is there any open source project so that I can their working in this scenario (ie multiple event capture) On Nov 10, 9:33 pm, saqib [EMAIL PROTECTED] wrote: I am developing an application in which I have to define click events for many elements( the list may go up to hundreds). So what would be the best way tocapturetheseevent Either using a * bind( $('*') ); and in click function get the id of target element and code accordingly OR use a separate bind method for every element. $('#elementID').click(function(){ bind( ); });
[jQuery] Re: can you simplify this selector? easy for you...
Following on from Karl, how about: $('#PG1_L03-table td:nth-child(2n+3)').slice(0, 4).find('input') 2008/11/12 Lisaraël [EMAIL PROTECTED]: $('#PG1_L03-table td:nth-child(odd) input') ? (untested too) -- Rik Lomas http://rikrikrik.com
[jQuery] Re: Event Capture Architecture
I would do a seperate bind method for each element saqib wrote: Is there any open source project so that I can their working in this scenario (ie multiple event capture) On Nov 10, 9:33 pm, saqib [EMAIL PROTECTED] wrote: I am developing an application in which I have to define click events for many elements( the list may go up to hundreds). So what would be the best way tocapturetheseevent Either using a * bind( $('*') ); and in click function get the id of target element and code accordingly OR use a separate bind method for every element. $('#elementID').click(function(){ bind( ); });
[jQuery] Re: can you simplify this selector? easy for you...
Ah yeah, damn you :nth-child for being one-indexed 2008/11/12 Karl Swedberg [EMAIL PROTECTED]: On Nov 12, 2008, at 9:05 AM, Rik Lomas wrote: This is completely untested, but this is a bit simpler: $('#PG1_L03-table').find('td:eq(3), td:eq(5), td:eq(7), td:eq(9)').find('input').bind.. That won't work, because it'll only select the 4th, 6th, 8th, and 10th TD. 2008/11/12 ggerri [EMAIL PROTECTED]: have the following selector and wonder how this could be simplified? :confused: $('#PG1_L03-table td:nth-child(3) input, #PG1_L03-table td:nth-child(5) input, #PG1_L03-table td:nth-child(7) input, #PG1_L03-table td:nth-child(9) input').bind.. need to bind an event to all input fields of col 3, 5, 7 and 9 but only for table PG1_L03-table. You could try this: $('#PG1_L03-table td:nth-child(2n+3)').bind ... That will also get cols 11, 13, etc., so if you need to stop at 9, let me know and I'll think about it some more. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com -- Rik Lomas http://rikrikrik.com
[jQuery] Sortable type behavior?
I need to allow the user to re-order a number of DIVs on the screen, each of which contains a title DIV that would be the drag handle. UI's sortables seems almost perfect, but I don't see how I can apply it to the divs in my case... Any suggestions? A sample div might look something like: | title| | | | content | | | or div class=container div class=titleMy Title/div div class=contentSome content here/div /div Thanks in advance. Shawn
[jQuery] Re: Event Capture Architecture
For ease of coding, a separate bind method for each element is pretty straight forward. However when you are dealing with a large number of elements, and your processing needs to look at those large number of elements, then performance can get to be a problem. For instance $(.myclass).click( function () { ... }); This looks innocent enough, but if you have hundreds, or even thousands of elements on the page, then finding all the .myclass elements can take a while. Of course, narrowing down the selector helps - div.myclass for instance. I found this problem to be especially visible when dealing with a very dynamic page. (mine was a calendar type application where LOTS of info via Ajax that would result in updating the calendar and needing to reapply handlers). In cases like this, you'll probably be better off applying the click handler to a container element if possible, then using the event.target element to look at the element throwing the event. Oh, and if you need more data for processing than just the ID, don't forget about the jQuery.data() method HTH Shawn saqib wrote: I am developing an application in which I have to define click events for many elements( the list may go up to hundreds). So what would be the best way to capture these event Either using a * bind( $('*') ); and in click function get the id of target element and code accordingly OR use a separate bind method for every element. $('#elementID').click(function(){ bind( ); });
[jQuery] [jQuery][TreeView] does it support drag and drop ?
Hi all, I wonder jQuery TreeView support drag and drop, anyone knows ? Thanks for reading and looking for any reply ;) bowlkhin
[jQuery] Re: Character encoding problem when using ajax .load
James C wrote on 11/12/2008 9:58 AM: I need to somehow keep the file as latin-1 but get jquery/javascript to understand it, either by encoding it as utf-8 (on the fly) or some other crazy means. You need to specify the character set in the response header. - Bil
[jQuery] Re: JSLitmus invaluable tool
Michael, I thought I had thanked you for your post yesterday but don't see that here today. Maybe I did a 'reply to author'? In any event, thanks again. I implemented your code and see where I went wrong. Also thanks for a good demonstration of how to use the call ( ) function -- very nice. I've always found the online descriptions of call( ) rather confusing; yours is a nice clear demonstration of its usefulness. You are correct that my 'this' turned out to be the window object. Bad! Howard On Nov 11, 10:23 am, Michael Geary [EMAIL PROTECTED] wrote: JSLitmus isn't testing what it appears to be testing. In the 'use instance var' case, take a look at what this is inside the test function. I'll bet it's the window object. That is the reason it's so much slower in Firefox. I didn't try it in IE, but the difference is probably even more dramatic there. It's not surprising that there is little difference in Chrome, with its completely different architecture. If 'this' a native JavaScript object, it's still slower to reference this.foo than it would be to reference foo, but not by such a great difference. Compare with this test that provides known values of this: var total = 100; function Test() {} Test.prototype.one = function() { var t1 = +new Date; var n = total; var x = 0; while( n-- ) x++; var t2 = +new Date; console.log( ( t2 - t1 ) / 1000 );}; Test.prototype.two = function() { var t1 = +new Date; var n = total; this.x = 0; while( n-- ) this.x++; var t2 = +new Date; console.log( ( t2 - t1 ) / 1000 ); }; test = new Test; test.one(); test.two(); test.one.call(window); test.two.call(window); In an example run, that logged these values to the Firebug console: 0.051 - test.one() 0.199 - test.two() 0.052 - test.one.call(window) 2.408 - test.two.call(window) As you can see, test.two() is several times slower than test.one() when it's called as a method of the test object, but dramatically slower when it's called as a method of the window object. -Mike From: howardk I've been experimenting with several different coding styles for plug- ins. Lately I've been curious about the difference in performance between using local variables vs. instance variables for storing state. JSLitmus, while not itself jQuery-based, has just given me the answers I've been looking for. I found them a bit surprising: http://www.fatdog.com/litmus_tests/InstanceVsLocalTest.html (Apologies for the color scheme! :-) Howard
[jQuery] TableSorter not correctly sorting GridViews
Hello, I have a GridView, and applied to this GridView is the TableSorter jQuery Plug-in. As mentions it does not seem to be sorting correctly! Especially in the case of number where it sometimes using the first number to sort. Thus 70 is considered higher than 100! I am not sure what's causing this so any ideas would be helpful :). Some elements of the set up: The GridView's data is done programatically in code-behind Tablesorter is across 3 gridviews using a css selector for each. But I tried applying it to one table only and the bug still occurred. Thanks
[jQuery] Re: [jQuery][TreeView] does it support drag and drop ?
Ah, thank u Jorn :) -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: 13 Tháng Mười Một 2008 12:11 SA To: jquery-en@googlegroups.com Subject: [jQuery] Re: [jQuery][TreeView] does it support drag and drop ? The treeview plugin as-is doesn't support drag and drop. Its planned to be included in a future version of jQuery UI, with full d'n'd support. There is some experimental code in a branch somewhere... Jörn On Wed, Nov 12, 2008 at 5:51 PM, Pham Anh Tuan [EMAIL PROTECTED] wrote: Hi all, I wonder jQuery TreeView support drag and drop, anyone knows ? Thanks for reading and looking for any reply ;) bowlkhin
[jQuery] Re: [jQuery][TreeView] does it support drag and drop ?
The treeview plugin as-is doesn't support drag and drop. Its planned to be included in a future version of jQuery UI, with full d'n'd support. There is some experimental code in a branch somewhere... Jörn On Wed, Nov 12, 2008 at 5:51 PM, Pham Anh Tuan [EMAIL PROTECTED] wrote: Hi all, I wonder jQuery TreeView support drag and drop, anyone knows ? Thanks for reading and looking for any reply ;) bowlkhin
[jQuery] Re: Tab divs disappear
Do your anchors inside the tabs list look like this: a href=/some/url.../a or like this: a href=#identifier.../a ? The initialization is the same, no matter if Ajax tabs or in-page. --Klaus On 12 Nov., 17:09, aaron [EMAIL PROTECTED] wrote: I'm not sure what you mean, what initialization code should I use? I tried putting the AJAX options in there, but got the same result. On Nov 11, 3:48 pm, Klaus Hartl [EMAIL PROTECTED] wrote: And you're not using Ajax tabs? Rotate and Ajax together is not supported right now. --Klaus On 11 Nov., 20:39, aaron [EMAIL PROTECTED] wrote: $(function() { $('#tabs_container ul').tabs( {fx: { opacity: 'toggle' } }).tabs('rotate', 5000); }); On Nov 7, 4:20 pm, Klaus Hartl [EMAIL PROTECTED] wrote: On 7 Nov., 21:43, subnet_rx [EMAIL PROTECTED] wrote: I'm using jQuery UI tabs and I'm rotating them automatically. The problem is, for half a second, the div disappears till the next one loads. This modifies the size of the page and the page jumps around while this is going on. The divs only contain static content, and I've tried AJAX cache options, but they don't work. I just want them to fade out and fade in. What initialization code should I be using? What initialization code should do you use? --Klaus
[jQuery] can you simplify this selector? easy for you...
Hi Gurus have the following selector and wonder how this could be simplified? :confused: $('#PG1_L03-table td:nth-child(3) input, #PG1_L03-table td:nth-child(5) input, #PG1_L03-table td:nth-child(7) input, #PG1_L03-table td:nth-child(9) input').bind.. need to bind an event to all input fields of col 3, 5, 7 and 9 but only for table PG1_L03-table. Any help appreciated :handshake: -- View this message in context: http://www.nabble.com/can-you-simplify-this-selector--easy-for-you...-tp20459678s27240p20459678.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: [HELP] How do I get attribute's value of selected node ?
Thank u, Shawn, While waiting for any solution, I found that livequery can help me in this situation. Again, thanks for your support, Shawn :-) bowlkhin _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Shawn Sent: 10 Tháng Mười Một 2008 10:37 SA To: jquery-en@googlegroups.com Subject: [jQuery] Re: [HELP] How do I get attribute's value of selected node ? Need a little more detail. How are you selecting a node? If I assume for a moment you have a class called myClass on the nodes/elements that can be selected, and that you are selecting these nodes by clicking on them, then you can get the ID like this: $(.myClass).click( function () { var theID = $(this).attr(id); // ... do something with the id }); You can get ANY attribute using the .attr() method. HTH Shawn On Sunday 09 November 2008 19:30:45 Pham Anh Tuan wrote: Hi all, I'm stucking in this trouble about 2 hours T___T Because I have to get data from server by ID of selected node, and till now I found no way to get it :( Plz help and show me how to get the value of ID Atrribute of selected node in JQuery TreeView? Thanks for reading, bowlkhin
[jQuery] Re: ClueTip iframe issue
On Nov 11, 2008, at 3:14 PM, Rmesser wrote: I have a website with navigation containing cluetip which functions properly, until I hit a page with an iframe. The title area of clueTip goes transparent, Title is displayed and Close link displayed over drop shadow. Both FF and IE. Does the content area of clueTip display properly? Do you have a test page I can look at? thanks, --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: ActsAsTreeTable plugin IE 6 issue
Finally fixed it. image was using a left margin of -19px, so it was going out of the table. Image was visible once I added a left padding of 19 px on the td of the first node. Anyways, just updated in case someone faces the same problem.
[jQuery] Re: get the class that starts with ...
Per Richard's comment, if you know the tag names of the elements that will match the class (like div, p), you can do the following: $(div,p).filter(function(){ var classes = $(this).attr(className).split( ); var found = false; for (var i = 0; i classes.length; i++){ if ( classes[i].substr(0,4) == rate ){ found = true; break; } } return found; }); This creates an array of all the classes on each matched element and loops over them, testing if the first four characters are rate, and removing the elements that fail the test from the wrapped set. It wouldn't be hard to create a more generic jQuery plugin from this, maybe one that accepts a parameter for the string to test. Anyone, feel free to correct my code if there is an error. Bradley~ On Nov 11, 6:29 pm, Richard D. Worth [EMAIL PROTECTED] wrote: Don't forget that elements can have more than one class (each separated by a space), so such a test will only pass if it's the first in the list. - Richard On Tue, Nov 11, 2008 at 6:22 PM, Rik Lomas [EMAIL PROTECTED] wrote: To get a class that begins with 'rate', you can do $('*[className^=rate]') Note that the attribute is className, not class $('*[className^=rate]').each(function () { alert( $(this).attr('className').split('rate')[1] ); }); 2008/11/11 debussy007 [EMAIL PROTECTED]: Hi, How is it possible to get the class that starts with 'rate' of an element ? the class could be rate1, rate5, rateXYZ. I don't know what follows the substring 'rate'. I need to get the number that follows rate. Thank you for any help ! -- View this message in context: http://www.nabble.com/get-the-class-that-starts-with-...-tp20450061s2... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: Tab divs disappear
Ahh, thanks, the light bulb just clicked on. In order for AJAX to work, the html code is different, not the initialization code. I think I kept glossing over that in the documentation. On Nov 12, 11:29 am, Klaus Hartl [EMAIL PROTECTED] wrote: Do your anchors inside the tabs list look like this: a href=/some/url.../a or like this: a href=#identifier.../a ? The initialization is the same, no matter if Ajax tabs or in-page. --Klaus On 12 Nov., 17:09, aaron [EMAIL PROTECTED] wrote: I'm not sure what you mean, what initialization code should I use? I tried putting the AJAX options in there, but got the same result. On Nov 11, 3:48 pm, Klaus Hartl [EMAIL PROTECTED] wrote: And you're not using Ajax tabs? Rotate and Ajax together is not supported right now. --Klaus On 11 Nov., 20:39, aaron [EMAIL PROTECTED] wrote: $(function() { $('#tabs_container ul').tabs( {fx: { opacity: 'toggle' } }).tabs('rotate', 5000); }); On Nov 7, 4:20 pm, Klaus Hartl [EMAIL PROTECTED] wrote: On 7 Nov., 21:43, subnet_rx [EMAIL PROTECTED] wrote: I'm using jQuery UI tabs and I'm rotating them automatically. The problem is, for half a second, the div disappears till the next one loads. This modifies the size of the page and the page jumps around while this is going on. The divs only contain static content, and I've tried AJAX cache options, but they don't work. I just want them to fade out and fade in. What initialization code should I be using? What initialization code should do you use? --Klaus
[jQuery] Re: Validator Plugin ajaxSubmit
Ah, found it. Need to appendTo(body) first, then hide. Its fixed in the latest revision. Jörn On Wed, Nov 12, 2008 at 11:14 AM, Jörn Zaefferer [EMAIL PROTECTED] wrote: That seems to be a bug in this code, with some Safari specific problem: var loader = jQuery('div id=loaderimg src=images/loading.gif alt=loading... //div') .css({position: relative, top: 1em, left: 25em}) .hide() .appendTo(body); Not sure yet whats wrong with that, any ideas are welcome. Jörn On Tue, Nov 11, 2008 at 11:16 PM, lance123 [EMAIL PROTECTED] wrote: Hi To All, I am having a problem with Safari using the standard test example the loading image starts prior to any activity in fields or buttons: http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html Really looking forward to getting ajax and validation co-existing :) Thanks for any help on this, Lance
[jQuery] serializing array of html elements using Jquery
I am having a problem.. form input type='text' name='items[1][amount]' value='10' / input type='text' name='items[1][label]' value='10' / input type='text' name='items[2][amount]' value='10' / input type='text' name='items[2][label]' value='10' / /form i can access each elements using $('[name^=items').each().. But i want them as an array.. so that i can do some operation. Thanks in advance.
[jQuery] [Superfish] Third horizontal navigation?
Hello I've try to put a third horizontal navigation with Superfish instead vertical. How I can do that easly? Is that possible? Thx for yoru feedback. Dom -- View this message in context: http://www.nabble.com/-Superfish--Third-horizontal-navigation--tp20457772s27240p20457772.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] [Superfish] Third horizontal navigation?
Please avoid killing someone else's thread by changing the subject. How to unsubscribe: http://groups.google.com/support/bin/answer.py?answer=46608src=top5lev=index --Klaus On 12 Nov., 11:36, SEAN CLIFFORD [EMAIL PROTECTED] wrote: unsubscribe _ Get 30 Free Emoticons for your Windows Live Messengerhttp://www.livemessenger-emoticons.com/funfamily/en-ie/
[jQuery] Re: Parsing JSON with JQuery
Here is an example of autocomplete with JSON data: http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html You have to follow it along quite closely - that API for working with JSON is still rather ugly. Jörn On Wed, Nov 12, 2008 at 2:25 AM, nic [EMAIL PROTECTED] wrote: Hi, I have the following JSON data: {field1:null,field2:null,field3:null,field4:null,employees: [Joe,David]} I'm using JQuery autocomplete and just need the values from employees (Joe and David). Right now I have this in my JavaScript $(#myinput).autocomplete(myaction.action, { delay: 10, minChars: 3, matchSubset: 1, matchContains: 1, cacheLength: 1, autoFill: true, formatItem: formatItem }); function formatItem(row) { return row; }; but what this does is return the entire row (obviously), i.e.: {field1:null,field2:null,field3:null,field4:null,employees: [Joe,David]} What do I need to do so that I just get the values from employees? I've also tried playing around with the parse parameter but can't get anywhere with it at all. Cheers! nic
[jQuery] Re: Taconite - remove surrogate div
In case someone runs into the same issue, I've attached a patch to remove the temporary div. In short this snippet moves the content after the div and then removes the div. Not sure if this will have nasty side effects though. regards bob Index: jquery.taconite.js --- jquery.taconite.js Base (BASE) +++ jquery.taconite.js Locally Modified (Based On LOCAL) @@ -150,6 +150,7 @@ continue; } var cdataWrap = cmdNode.getAttribute('cdataWrap') || $.taconite.defaults.cdataWrap; +var unwrap = []; var a = []; if (cmdNode.childNodes.length 0) { @@ -178,7 +179,13 @@ log(invoking command: $(', q, ')., cmd, '('+ arg +')'); } jq[cmd].apply(jq,a); + +// Unwrap cdataWrap element contents +while (el = unwrap.shift()) { +var jel = $(el); +jel.after(jel.html()).remove(); } +} // apply dynamic fixes if (doPostProcess) postProcess(); @@ -217,6 +224,8 @@ function handleCDATA(s) { var el = document.createElement(cdataWrap); +// Add cdataWrap element, to be unwrapped later +unwrap.push(el); el.innerHTML = s; return el; }; Bob Schellink wrote: Hi Mike, Thanks for your feedback. Your solution does work in the scenario I described where only one link is used. However it is possible to return multiple elements for example: taconite append a href=...hello/a a href=...hi/a /append /taconite To provide some context, I am integrating taconite into a component framework and do not have much control over the commands and their content. Hmm would it work to unwrap (does that even make sense) the div contents? kind regards bob Mike Alsup wrote: In order to do this taconite places the CDATA content inside a div element. However after the command is executed the div is left in the DOM. So after a bit of back and forth between browser and server we end up with a large hierarchy of divs. Hi Bob, Could you test this function to see if it fixes the issue for you? (just replace the current one in Taconite) function handleCDATA(s) { var el = document.createElement(cdataWrap); el.innerHTML = s; // remove wrapper node if possible var $el = $(el), $ch = $el.children(); if ($ch.size() == 1) return $ch[0]; return el; }; Thanks. Mike
[jQuery] [autocomplete] problem with hasFocus
I have been working on adding autocomplete into a plugin for the tinyMCE editor. For some reason in the popup the autocomplete would only work on a few occasions - mainly when I was using the debugger. I noticed that on line 314 in jQuery.autocomplete.js: if ( data data.length hasFocus ) { hasFocus was always 0. If I remove that value everything seems to work fine without side effect. Does anyone know what the implications of removing that value would be? As far as I can tell it is not critical. thanks
[jQuery] Visual Studio Intellisense Issues
Is anyone else having trouble getting the new VS 2008 intellisense to work? I have downloaded SP1 and the hotfix. I can get it working on the jquery file. However it seems to break on any plugin that uses this syntax: (function($) { ... } )(jQuery); Any thoughts or suggestions would help. This is a great feature that I would love to get working. Thanks, Dave
[jQuery] Re: can you simplify this selector? easy for you...
On Nov 12, 2008, at 11:13 AM, Rik Lomas wrote: Following on from Karl, how about: $('#PG1_L03-table td:nth-child(2n+3)').slice(0, 4).find('input') That won't work either, unless the table has only one row. Would have to do something like this instead: $('#PG1_L03-table tr').each(function() { $('td:nth-child(2n+3):lt(4)', this).find('input') }); Cheers, --Karl
[jQuery] Re: working with checkboxes
try: if ($(#test).is(:checked)) {} --- On Wed, 11/12/08, George [EMAIL PROTECTED] wrote: From: George [EMAIL PROTECTED] Subject: [jQuery] working with checkboxes To: jQuery (English) jquery-en@googlegroups.com Date: Wednesday, November 12, 2008, 1:11 PM I have a checkbox input type=checkbox id=test the $('#test').checked always returns undefined. No matter if checkbox checked or not... Is it how it's supposed to be? I thought that $('#test') will return me the object wrapped so i have original methods/properties as well as new one that came from JQuery. Am i mistaken? Thanks George.
[jQuery] Re: Jquery in Drupal
What you really need is the ID of the generated form element. Use the browser view source feature to see what you get for a form ID, then you can something like: drupal_add_js('$(#id-of-the-form).submit(function() { return false; });', 'inline'); Of course, change id-of-the-form to the actual ID. If you pass 'inline' to the second argument of drupal_add_js, it will add a script tag for you with the script content in the first argument. (you can also leave off the 'inline' and pass a relative path to a .js file... grep in the drupal modules dir for drupal_add_js to see many examples). Cheers, --fletch On Nov 11, 8:19 am, bharani kumar [EMAIL PROTECTED] wrote: Hi , U see , I am creating the custom form, the form contain 3 fields, when i submit the form , the page is reloading, so here i want to stop The page reload, so i want to use the JQuery , bcoz we can stop page reload using jquery, So here i need ur help the below code is my custom module code, tell me where i call the Jquery, this is my form function cityForm(){ $form['txtWhere'] = array( '#title' = t('Where'), '#type' = 'textfield', '#description' = t(''), '#required' = TRUE, ); $form['name'] = array( '#title' = t('Check-In'), '#type' = 'textfield', '#description' = t(''), '#attributes' = array('class' = 'jscalendar'), '#jscalendar_ifFormat' = '%Y-%m-%d %H:%M', '#jscalendar_showsTime' = 'true', ); $form['txtChkOut'] = array( '#title' = t('Check-Out'), '#type' = 'textfield', '#description' = t(''), '#attributes' = array('class' = 'jscalendar'), '#jscalendar_ifFormat' = '%Y-%m-%d %H:%M', '#jscalendar_showsTime' = 'true', ); $form['guest'] = array( '#type' = 'select', '#title' = t('Guests'), '#options' = array( 1 = '1', 2 = '2', 3 = '3', 4 = '4', 5 = '5', ), '#default_value' = '1', '#description' = t(''), '#required' = TRUE ); $form['rooms'] = array( '#type' = 'select', '#title' = t('Rooms'), '#options' = array( 1 = '1', 2 = '2', 3 = '3', 4 = '4', 5 = '5', ), '#default_value' = '1', '#description' = t(''), '#required' = TRUE ); $form['submit'] = array( '#type' = 'submit', '#value' = t('submit') ); return $form; } This is genral form with submit action, if we process this form, If u submit the form, the page get reload, So i dont want to reload the page, at the time of form submit, So u please add the Jquery , and stop the page refresh 2008/11/11 bharani kumar [EMAIL PROTECTED] Thanks for reply, I want to integrate the Jquery in drupal Am using the drupal 5, Can u send any sample module , that sample module must contain the JQuery functionality , On Tue, Nov 11, 2008 at 9:22 PM, Eric Martin [EMAIL PROTECTED] wrote: Can you provide more information? - What version of Drupal are you using? - What are you trying to do? - What have you tried so far? On Nov 11, 6:38 am, bharani kumar [EMAIL PROTECTED] wrote: Hi Any one please tell me, how to use the jquery in Drupal, -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINIONhttp://bharanikumariyer.hyperphp.com/ -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyer.hyperphp.com/ -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINIONhttp://bharanikumariyer.hyperphp.com/
[jQuery] Re: working with checkboxes
Thanks, But I think that if (document.getElementById('test').checked ) {} would be better...performance wise and readability is better Is there problem with this approach? PS: Is there shorter syntaxes for document.getElementById('test')? Thanks George. On Nov 12, 1:25 pm, ripple [EMAIL PROTECTED] wrote: try: if ($(#test).is(:checked)) {} --- On Wed, 11/12/08, George [EMAIL PROTECTED] wrote: From: George [EMAIL PROTECTED] Subject: [jQuery] working with checkboxes To: jQuery (English) jquery-en@googlegroups.com Date: Wednesday, November 12, 2008, 1:11 PM I have a checkbox input type=checkbox id=test the $('#test').checked always returns undefined. No matter if checkbox checked or not... Is it how it's supposed to be? I thought that $('#test') will return me the object wrapped so i have original methods/properties as well as new one that came from JQuery. Am i mistaken? Thanks George.
[jQuery] Re: link fade in / out
No... it does the same thing that the hover function does =( I don't want stuff to be added to the queue, the queue should have at most 1 item at the time.. thanks for your answer though. Anyone else? On 12 Nov, 10:04, Liam Potter [EMAIL PROTECTED] wrote: not entirely sure if it will work this way but try $(a).bind(mouseenter,function(){ $(this).fadeTo(500,1); } }); $(a).bind(mouseleave,function() { $(this).fadeTo(300,0.33); }); Althalos wrote: *bump* On 11 Nov, 19:15, Althalos [EMAIL PROTECTED] wrote: Hi. I have a menu consisting of some simple text links. They start with an opacity of 0.33 then when I move my mouse over them they lit up. They worked well, however the effects wanted to stack up in a queue so that when I had swept my mouse over the links a couple of times fast they would keep fading in and fading out as many times as I had swept my mouse over them. What I want is a link that lights up when you move the mouse across it, then fades down and keeps faded out until I sweep my mouse over it again. So I added .stop, which didn't work to well. I was hoping someone would correct me. What happens right now is that sometimes (often) links get stopped in the middle, with an opacity which is neither 0.33 nor 1. Also some links freeze and don't respond to moue hover... thank you. $(a).hover(function(){ $(this).fadeTo(500,1); }, function() { $(this).fadeTo(300,0.33, function () { $(this).stop({gotoEnd:true}); }); });
[jQuery] How to avoid triggering two patterns that match - from a JavaScript/jQuery lightweight
Hi, I am trying to limit the scope of a click trigger to the first/next matched target. This works fine if I have one container of class .expander.map but as soon as I add another, they both respond (I guessed they would ;) $('.linkify.map').click(function() { $('.expander.map').show(); }); I have tried using $(this) and .next() but likely not correctly... I am _certain_ this is stupidly simple and I am missing the obvious. Grateful if anyone can point me in the right direction. Cheers lots in advance! [I am a lightweight (little experience) when it comes to JavaScript/ jQuery, so much so that even though I have jQuery Ref and Learning books, I still have not sussed this. What am I like...]
[jQuery] Re: How to avoid triggering two patterns that match - from a JavaScript/jQuery lightweight
Try $('.linkify.map:first'). That should return the first matched element. -Hector On Wed, Nov 12, 2008 at 11:04 AM, alanfluff [EMAIL PROTECTED]wrote: Hi, I am trying to limit the scope of a click trigger to the first/next matched target. This works fine if I have one container of class .expander.map but as soon as I add another, they both respond (I guessed they would ;) $('.linkify.map').click(function() { $('.expander.map').show(); }); I have tried using $(this) and .next() but likely not correctly... I am _certain_ this is stupidly simple and I am missing the obvious. Grateful if anyone can point me in the right direction. Cheers lots in advance! [I am a lightweight (little experience) when it comes to JavaScript/ jQuery, so much so that even though I have jQuery Ref and Learning books, I still have not sussed this. What am I like...]
[jQuery] Re: jeditable autocomplete - time to revisit?
Wow, that was sooo simple. Works like a charm! Impressive.. Now, thats the way a plugin should work. Nice work Mike. -jl On Nov 12, 7:04 am, Mika Tuupola [EMAIL PROTECTED] wrote: On Nov 12, 2008, at 10:28 AM, Mika Tuupola wrote: On Nov 12, 2008, at 1:46 AM, [EMAIL PROTECTED] wrote: I was wondering if it my be possible to add autocomplete functionality using the addInputType API. It looks like it might be possible to attach autocomplete to the text input through the element: argument when declaring a custom input type. It should be fairly easy. Usually you just to need to create the element using element and add plugin to it using plugin. It is basically 5 lines of code. Quick and dirty autocomplete input for Jeditable: -cut- $.editable.addInputType('autocomplete', { element : $.editable.types.text.element, plugin : function(settings, original) { $('input', this).autocomplete(settings.autocomplete.data); } }); -cut- Then you can call it with something like: -cut- $(.autocomplete).editable(http://www.example.com/save.php;, { type : autocomplete, tooltip : Click to edit..., onblur : submit, autocomplete : { data : [Aberdeen, Ada, Adamsville, Addyston, Adelphi, Adena, Adrian, Akron] } }); -cut- -- Mika Tuupolahttp://www.appelsiini.net/
[jQuery] Re: fade a background color
Take a look at jQuery UI Effects Color Animations: http://docs.jquery.com/UI/Effects/ColorAnimations - Richard On Wed, Oct 29, 2008 at 3:24 PM, evanct [EMAIL PROTECTED] wrote: so i wanted to have some links in which the background color fades in and out on hover. thing is, though, i wanted to have the text of the links not fade - only the background-color. so i thought, okay, i'll just make three elements: a parent div, a child display:block link, and another child link, this one with a high z-index. this way i can fade the first child link, and since the second child has a high z-index, it will stay above the fade. so i do that: script type=text/javascript $(document).ready(function(){ $(.animate).fadeTo(slow, 0.1); $(.animate).hover(function(){ $(this).fadeTo(slow, 1.0); },function(){ $(this).fadeTo(slow, 0.1); }); }); /script body . div id=links a href=# class=animate/aa href=# class=secondLorem/a a href=# class=animate/aa href=# class=secondLorem/a a href=# class=animate/aa href=# class=secondLorem/a /div ... /body /html but then i realize that jquery can't do classes, only ids. and i can't do $(#links a).fadeTo(slow, 0.1); because that will fade both classes of links, when i only want the .animate links to fade. so, uh, anyone know of a way to fade only a background color/image without fading the text?
[jQuery] Re: How to avoid triggering two patterns that match - from a JavaScript/jQuery lightweight
Thanks _lots_ for the quick reply Hector -- I'll go try that. Cheers! On Nov 12, 2:22 pm, Hector Virgen [EMAIL PROTECTED] wrote: Try $('.linkify.map:first'). That should return the first matched element. -Hector On Wed, Nov 12, 2008 at 11:04 AM, alanfluff [EMAIL PROTECTED]wrote: Hi, I am trying to limit the scope of a click trigger to the first/next matched target. This works fine if I have one container of class .expander.map but as soon as I add another, they both respond (I guessed they would ;) $('.linkify.map').click(function() { $('.expander.map').show(); }); I have tried using $(this) and .next() but likely not correctly... I am _certain_ this is stupidly simple and I am missing the obvious. Grateful if anyone can point me in the right direction. Cheers lots in advance! [I am a lightweight (little experience) when it comes to JavaScript/ jQuery, so much so that even though I have jQuery Ref and Learning books, I still have not sussed this. What am I like...]
[jQuery] Form Submit does not Submit Data but its Callback Function works
Hi List, please take a look, heres my sample code: $(.form-config-content-make-button).click(function() { $(#form-config-content-make).submit(top.$.nyroModalRemove()); }); Right now: The Nyromodal window gets removed but it doesnt fire submit. Greets, Martin
[jQuery] livequery Component returned failure code: 0xc1f30001
alright, this one is a different one... I don't even know what I'm supposed to be looking for in order to debug this. Below is a Firebug console error. Anyone has some insight? much obliged! [Exception... Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIDOMJSWindow.setTimeout] nsresult: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) location: JS frame :: file:///C:/lib/livequery-1.0.2.js :: anonymous :: line 1 data: no] data()(Document , events, undefined)jquery-1.2.6.js (line 679) remove()(Document , undefined, undefined)jquery-1.2.6.js (line 1912) unbind()()jquery-1.2.6.js (line 2244) each()(Object length=25 0=html 1=head 2=script 3=script 4=script, function(), undefined)jquery-1.2.6.js (line 745) each()(function(), undefined)jquery-1.2.6.js (line 138) unbind()(undefined, undefined)jquery-1.2.6.js (line 2243) (?)()()jquery-1.2.6.js (line 2414) one()(Object originalEvent=Event unload type=unload)jquery-1.2.6.js (line 2235) handle()(Object originalEvent=Event unload type=unload)jquery-1.2.6.js (line 2076) (?)()()jquery-1.2.6.js (line 1858) remove()(undefined)jquery-1.2.6.js (line 1317) each()(Object length=1 0=iframe.popupDetail prevObject=Object, function (), [])jquery-1.2.6.js (line 734) each()(function(), [])jquery-1.2.6.js (line 138) (?)()()jquery-1.2.6.js (line 1331) (?)()()3DYR8yd%...e3Q%3D%3D (line 1) (?)()()popup.htm (line 189) handle()(Object originalEvent=Event click which=1 view=window) jquery-1.2.6.js (line 2076) (?)()()jquery-1.2.6.js (line 1858) [Break on this error] jQuery.cache[ id ][ name ] :
[jQuery] Re: Form Submit does not Submit Data but its Callback Function works
It may be better to observe form's submit event instead of the buttons. This fires the event no matter how the form was submitted (for example, press enter when an input field is focused). (#form-config-content-make).submit(function() { top.$.nyroModalRemove(); return true; // submits the form }); -Hector On Wed, Nov 12, 2008 at 11:42 AM, Martin Möller [EMAIL PROTECTED] wrote: Hi List, please take a look, heres my sample code: $(.form-config-content-make-button).click(function() { $(#form-config-content-make).submit(top.$.nyroModalRemove()); }); Right now: The Nyromodal window gets removed but it doesnt fire submit. Greets, Martin
[jQuery] Re: How to avoid triggering two patterns that match - from a JavaScript/jQuery lightweight
Almost what I want - but the first map is always the one shown, I could have explained better, my bad, sorry. Pseudo code for what I have: . . click-to-trigger-map mapOne[div] . . click-to-trigger-map mapTwo[div] . . etc The :first seems to make mapOne display, regardless which click-to- trigger I click. It looks as if the scope of the :first is the whole DOM and no starting from the point where the click occurred and affecting the first instance after it (which is what I want). Thanks in advance for any further help! Cheers, -Alan On Nov 12, 2:36 pm, alanfluff [EMAIL PROTECTED] wrote: Thanks _lots_ for the quick reply Hector -- I'll go try that. Cheers! On Nov 12, 2:22 pm, Hector Virgen [EMAIL PROTECTED] wrote: Try $('.linkify.map:first'). That should return the first matched element. -Hector On Wed, Nov 12, 2008 at 11:04 AM, alanfluff [EMAIL PROTECTED]wrote: Hi, I am trying to limit the scope of a click trigger to the first/next matched target. This works fine if I have one container of class .expander.map but as soon as I add another, they both respond (I guessed they would ;) $('.linkify.map').click(function() { $('.expander.map').show(); }); I have tried using $(this) and .next() but likely not correctly... I am _certain_ this is stupidly simple and I am missing the obvious. Grateful if anyone can point me in the right direction. Cheers lots in advance! [I am a lightweight (little experience) when it comes to JavaScript/ jQuery, so much so that even though I have jQuery Ref and Learning books, I still have not sussed this. What am I like...]
[jQuery] Re: How to avoid triggering two patterns that match - from a JavaScript/jQuery lightweight
You're right, $('.linkify.map:first') will always return the first element that matches linkify.map. If you want to make it in respect to a container, try $('#container').find('.linkify.map') -Hector On Wed, Nov 12, 2008 at 11:49 AM, alanfluff [EMAIL PROTECTED]wrote: Almost what I want - but the first map is always the one shown, I could have explained better, my bad, sorry. Pseudo code for what I have: . . click-to-trigger-map mapOne[div] . . click-to-trigger-map mapTwo[div] . . etc The :first seems to make mapOne display, regardless which click-to- trigger I click. It looks as if the scope of the :first is the whole DOM and no starting from the point where the click occurred and affecting the first instance after it (which is what I want). Thanks in advance for any further help! Cheers, -Alan On Nov 12, 2:36 pm, alanfluff [EMAIL PROTECTED] wrote: Thanks _lots_ for the quick reply Hector -- I'll go try that. Cheers! On Nov 12, 2:22 pm, Hector Virgen [EMAIL PROTECTED] wrote: Try $('.linkify.map:first'). That should return the first matched element. -Hector On Wed, Nov 12, 2008 at 11:04 AM, alanfluff [EMAIL PROTECTED]wrote: Hi, I am trying to limit the scope of a click trigger to the first/next matched target. This works fine if I have one container of class .expander.map but as soon as I add another, they both respond (I guessed they would ;) $('.linkify.map').click(function() { $('.expander.map').show(); }); I have tried using $(this) and .next() but likely not correctly... I am _certain_ this is stupidly simple and I am missing the obvious. Grateful if anyone can point me in the right direction. Cheers lots in advance! [I am a lightweight (little experience) when it comes to JavaScript/ jQuery, so much so that even though I have jQuery Ref and Learning books, I still have not sussed this. What am I like...]
[jQuery] Re: TableSorter not correctly sorting GridViews
I'm not sure what a GridView is but if it's a table, are you sure it's formatted correctly? In cases where it's sorting lexicographically instead of numerically, something must be throwing it off. Do you have tds in that colgroup with non-numeric values? You can force numeric sorting of a colgroup by explicitly defining your parser for that column. stephen On Wed, Nov 12, 2008 at 08:59, Damien [EMAIL PROTECTED] wrote: Hello, I have a GridView, and applied to this GridView is the TableSorter jQuery Plug-in. As mentions it does not seem to be sorting correctly! Especially in the case of number where it sometimes using the first number to sort. Thus 70 is considered higher than 100! I am not sure what's causing this so any ideas would be helpful :). Some elements of the set up: The GridView's data is done programatically in code-behind Tablesorter is across 3 gridviews using a css selector for each. But I tried applying it to one table only and the bug still occurred. Thanks
[jQuery] Tabs not working in IE, fine in FF
I have set up a tabbed section for different parts of my portfolio. It works great in Firefox, no problems, but when I try it in IE 7 it doesn't work at all. I'm a noob when it comes to JavaScript/jQuery (trying to learn though). Any ideas as to why would be appreciated. Check this out to see what I've got: http://413creativemedia.com/tab.html. Thanks in advance for the help.
[jQuery] Re: [Superfish] Third horizontal navigation?
Thx. But I can't find it. Because all four and fifth level are the same as... the vertical third. Dom On Nov 12, 3:12 pm, Joel Birch [EMAIL PROTECTED] wrote: I don't have an example to point you to, but it is definitely possible. How easy it is will depend on your CSS skills though. I guess you should start with the version that has the third tier vertical, and adjust that third tier to be more like the second. Joel.
[jQuery] Re: Tab scrolling
Hi, I manage to get the things up here http://www.uphigh.org/tab/index.html . The slow connection might take you some times. I look forward for comments and feedback, since it's definitely far from perfect. Regards, Jecki On Oct 20, 1:46 pm, Jecki [EMAIL PROTECTED] wrote: Hi, I'm also in the need of this feature. So I tried to come out with something and now I want to propose to the community. This is a basic thing that came into my mind. I don't how to show the demo. Can I attach a zip file (containing the demo page, js, css, etc) here? Regards, Jecki
[jQuery] Re: Form Submit does not Submit Data but its Callback Function works
$(.form-config-content-make-button).click(function() { $(#form-config-content-make).submit(top.$.nyroModalRemove()); }); That's not a callback function, it's a call me right now function because you've included the paretheses.
[jQuery] Re: Tabs not working in IE, fine in FF
I've done some looking at it looks like my var tabs = [ ]; doesn't return anything in IE, but it does in FF. I get an array on an alert in FF, but get a blank alert on IE. Any ideas? I've left the alert in for now. Thanks. On Nov 12, 12:50 pm, JD [EMAIL PROTECTED] wrote: I have set up a tabbed section for different parts of my portfolio. It works great in Firefox, no problems, but when I try it in IE 7 it doesn't work at all. I'm a noob when it comes to JavaScript/jQuery (trying to learn though). Any ideas as to why would be appreciated. Check this out to see what I've got:http://413creativemedia.com/tab.html. Thanks in advance for the help.
[jQuery] Re: PrettyCheckboxes not working with radio array names
Anyone know how to fix this? -- View this message in context: http://www.nabble.com/PrettyCheckboxes-not-working-with-radio-array-names-tp20412719s27240p20467067.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] selector to .wrap multiple elements in HTML
I am trying to figure out how to select 3 elements that occur together and wrap all 3 together (not individually) in a DIV tag. This is what I have: h1.../h1 p.../p p.../p h1.../h1 p.../p p.../p and I want to turn that into: div class='fade' h1.../h1 p.../p p.../p h1.../h1 p.../p p.../p /div I have tried using the (h1 + p + p) with .wrap, but this seems to detect the trio, but only wrap the last p. How can I make it wrap the trio together? Thanks! -Adam
[jQuery] Re: conditional remote validation
In this particular case, for example: current email: [EMAIL PROTECTED] The field above (sample form field) should only validate the email address if it is different than the user's current email address of [EMAIL PROTECTED]. Where is the documentation for a custom method? In the meantime, I have worked around the issue by adding a link that says Change Email which than shows an empty email box which gets validated regardless of the email that is entered (even if they enter their own). This way its less confusing to the user, to enter a new email address they are required to click something which than shows them an empty box. If they enter the same email address as their own account, it will tell them that its already in use, but that's ok. Thanks On Nov 12, 5:12 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: How and where do you decide what is valid? Either do it on the serverside, in which case you don't have to modify the clientside logic. Or on the clientside, in this case a custom method that returns (instead of the usual true/false) just a string dependency-mismatch. That cancels all further validation for that field (same as required dependencies). Jörn On Tue, Nov 11, 2008 at 10:21 PM, spellingcity [EMAIL PROTECTED] wrote: There is a particular scenario where I don't want the remote validation to actually get executed. In particular, this is when you have a field, say a username field and the user is editing the field and the value of the field is their current username. This is considered a valid username and remote check shouldn't execute. Any suggestions? Thanks- Hide quoted text - - Show quoted text -
[jQuery] pseudo-forms, .data(), oh my
I have been out of the jQuery loop recently, and have little exposure with the new data functions in jQuery. My situation is, I am refactoring an application (using jQuery, of course) which currently makes heavy use of what I can only describe as pseudo-forms; essentially, a page might contain many 'forms', although form tags are rarely used. Instead, the current JS form methods build a query string that is sent via XHR as a GET request. This is partly due to the fact that we use many HTML elements that normally aren't form elements (div's, p's, etc, for various reasons not under my control that I won't go into here), but also because the form elements are not physically close in the HTML structure and so grouping becomes a problem. A basic [mock] scenario: a login 'form', with user/password elements and a 'submit' button. When submit is clicked, it gets the text() of the user and password elements, contructs a query string from them, and then passes this to an XHR call. I am seeking thoughts as to whether -- and if so, how -- the jQuery data functionality could aid me. I do not need to store any extra information in the elements (expandos are not the issue here), so I'm not sure if the data functionality would aid me or not. Is there some paradigm whereby I can group non-form elements together, so that I can easily convert the items into a GET (or POST at times), and on the return trip, easily update said related items? I know that I could inject CSS classes for each specific form elements, so that I could use $('.form1') to interact with all the elements of form1, but this method seems suboptimal. What I was thinking, is created a middle tier that would exist as the data model for the form, and would contain basic methods for submitting/updating/etc. the form. This middle tier would the glue that would tie the data model to the 'form' elements, with the actual HTML elements doing nothing other than displaying what the model dictates, with the model being the de facto source of truth in relation to the data. Is there anything like this already? If not, do you think that the data functionality be a good or bad fit for me? Am I taking the complete wrong approach? Thanks in advance, ken
[jQuery] Re: jScrollPane snapping when link is clicked
Point the href to 'javascript:void(0)' It disables the href but the onclick event will still fire. On Nov 11, 2:32 pm, X10D3 [EMAIL PROTECTED] wrote: I have a list of links in my pane. When I click a link it snaps to the top of the pane and I have to click it again. Is there anyway I can fix this to where I can click the link and it doesn't snap to the top?
[jQuery] [jQuery][TreeView][Help] is there any way to implement an icon at the right side of each node ?
Hi all, I’m looking for your help in implementing an icon at the right side of each node, in jQuery TreeView. Why do I want to do that, simply I just want to have an icon, such as Delete icon, so that I can click on that icon to delete a node, or do sth like edit, or … an icon to show the current status (Lock, Unlock, etc) of a node :-) Thanks for reading, and looking for your reply :-) bowlkhin _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ken Sent: 13 Tháng Mười Một 2008 2:00 SA To: jquery-en@googlegroups.com Subject: [jQuery] pseudo-forms, .data(), oh my I have been out of the jQuery loop recently, and have little exposure with the new data functions in jQuery. My situation is, I am refactoring an application (using jQuery, of course) which currently makes heavy use of what I can only describe as pseudo-forms; essentially, a page might contain many 'forms', although form tags are rarely used. Instead, the current JS form methods build a query string that is sent via XHR as a GET request. This is partly due to the fact that we use many HTML elements that normally aren't form elements (div's, p's, etc, for various reasons not under my control that I won't go into here), but also because the form elements are not physically close in the HTML structure and so grouping becomes a problem. A basic [mock] scenario: a login 'form', with user/password elements and a 'submit' button. When submit is clicked, it gets the text() of the user and password elements, contructs a query string from them, and then passes this to an XHR call. I am seeking thoughts as to whether -- and if so, how -- the jQuery data functionality could aid me. I do not need to store any extra information in the elements (expandos are not the issue here), so I'm not sure if the data functionality would aid me or not. Is there some paradigm whereby I can group non-form elements together, so that I can easily convert the items into a GET (or POST at times), and on the return trip, easily update said related items? I know that I could inject CSS classes for each specific form elements, so that I could use $('.form1') to interact with all the elements of form1, but this method seems suboptimal. What I was thinking, is created a middle tier that would exist as the data model for the form, and would contain basic methods for submitting/updating/etc. the form. This middle tier would the glue that would tie the data model to the 'form' elements, with the actual HTML elements doing nothing other than displaying what the model dictates, with the model being the de facto source of truth in relation to the data. Is there anything like this already? If not, do you think that the data functionality be a good or bad fit for me? Am I taking the complete wrong approach? Thanks in advance, ken
[jQuery] Re: selector to .wrap multiple elements in HTML
Hi Adam, Take a look at the .wrapAll() method. that should get you closer. You'll need to select all of the elements first, though. $('h1 + p + p') only selects that final p. If you want to wrap the div around all h1 and p elements, you could try $('h1,p').wrapAll('div class=fade/div'); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 12, 2008, at 2:11 PM, Adam wrote: I am trying to figure out how to select 3 elements that occur together and wrap all 3 together (not individually) in a DIV tag. This is what I have: h1.../h1 p.../p p.../p h1.../h1 p.../p p.../p and I want to turn that into: div class='fade' h1.../h1 p.../p p.../p h1.../h1 p.../p p.../p /div I have tried using the (h1 + p + p) with .wrap, but this seems to detect the trio, but only wrap the last p. How can I make it wrap the trio together? Thanks! -Adam
[jQuery] Re: How to avoid triggering two patterns that match - from a JavaScript/jQuery lightweight
I think maybe something like this might work: $('.maps').click(function() { $(this).next('.expander.map').show(); }); That would expand the next map based on whatever was clicked. I hope this helps :) -Hector On Wed, Nov 12, 2008 at 12:04 PM, alanfluff [EMAIL PROTECTED]wrote: Yep. Get that. Tks. However, I am trying to make my code re-useable, right now there are two sets of trigger-and-map markup. I will have 10 to 20. I was hoping to find a jQ construct that would say: if a map-trigger is clicked, I will expand the map that immediately follows it in the DOM. That way I would not need to have an #id for each trigger/map in HTML and the jQ would be one lump of code, not a set of identical lumps, each one handling one of the trigger-and-maps. Thanks again for your reply - sorry if I'm not explaining myself well. Cheers, -Alan On Nov 12, 2:53 pm, Hector Virgen [EMAIL PROTECTED] wrote: You're right, $('.linkify.map:first') will always return the first element that matches linkify.map. If you want to make it in respect to a container, try $('#container').find('.linkify.map') -Hector On Wed, Nov 12, 2008 at 11:49 AM, alanfluff [EMAIL PROTECTED]wrote: Almost what I want - but the first map is always the one shown, I could have explained better, my bad, sorry. Pseudo code for what I have: . . click-to-trigger-map mapOne[div] . . click-to-trigger-map mapTwo[div] . . etc The :first seems to make mapOne display, regardless which click-to- trigger I click. It looks as if the scope of the :first is the whole DOM and no starting from the point where the click occurred and affecting the first instance after it (which is what I want). Thanks in advance for any further help! Cheers, -Alan On Nov 12, 2:36 pm, alanfluff [EMAIL PROTECTED] wrote: Thanks _lots_ for the quick reply Hector -- I'll go try that. Cheers! On Nov 12, 2:22 pm, Hector Virgen [EMAIL PROTECTED] wrote: Try $('.linkify.map:first'). That should return the first matched element. -Hector On Wed, Nov 12, 2008 at 11:04 AM, alanfluff [EMAIL PROTECTED]wrote: Hi, I am trying to limit the scope of a click trigger to the first/next matched target. This works fine if I have one container of class .expander.map but as soon as I add another, they both respond (I guessed they would ;) $('.linkify.map').click(function() { $('.expander.map').show(); }); I have tried using $(this) and .next() but likely not correctly... I am _certain_ this is stupidly simple and I am missing the obvious. Grateful if anyone can point me in the right direction. Cheers lots in advance! [I am a lightweight (little experience) when it comes to JavaScript/ jQuery, so much so that even though I have jQuery Ref and Learning books, I still have not sussed this. What am I like...]
[jQuery] Re: Tabs not working in IE, fine in FF
Ok, I've done some more debugging. This is what I have: $(function () { var tabs = []; var tabContainers = []; var tabContents = $('div.tabs div'); tabContents.hide().filter('#start').show(); tabContents.filter('div.tabs_nav_div').show(); $('ul.tabNavigation a').each(function () { alert('+this.pathname+' == '+window.location.pathname +'); // This Alert for debugging if (this.pathname == window.location.pathname) { tabs.push(this); tabContainers.push($(this.hash).get(0)); } }); $(tabs).click(function () { // hide all tabs $('#start').hide(); $(tabContainers).hide().filter(this.hash).show(); // set up the selected class $(tabs).removeClass('selected'); $(this).addClass('selected'); return false; }); }); When I compared the this.pathname == window.location.pathname in firefox they return the same value '/tabs.html', but in IE this.pathname returns 'tabs.html' and window.location.pathname returns '/tabs.html' Any ideas for a fix? Thanks. On Nov 12, 2:16 pm, JD [EMAIL PROTECTED] wrote: I've done some looking at it looks like my var tabs = [ ]; doesn't return anything in IE, but it does in FF. I get an array on an alert in FF, but get a blank alert on IE. Any ideas? I've left the alert in for now. Thanks. On Nov 12, 12:50 pm, JD [EMAIL PROTECTED] wrote: I have set up a tabbed section for different parts of my portfolio. It works great in Firefox, no problems, but when I try it in IE 7 it doesn't work at all. I'm a noob when it comes to JavaScript/jQuery (trying to learn though). Any ideas as to why would be appreciated. Check this out to see what I've got:http://413creativemedia.com/tab.html. Thanks in advance for the help.
[jQuery] Re: Visual Studio Intellisense Issues
Here are a couple of articles on it: http://brennan.offwhite.net/blog/2008/02/01/intellisense-for-jquery-in-visua l-studio-2008/ http://blogs.ipona.com/james/archive/2008/02/15/JQuery-IntelliSense-in-Visua l-Studio-2008.aspx http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intelli sense.aspx Hope this helps. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fontzter Sent: Wednesday, November 12, 2008 10:14 AM To: jQuery (English) Subject: [jQuery] Visual Studio Intellisense Issues Is anyone else having trouble getting the new VS 2008 intellisense to work? I have downloaded SP1 and the hotfix. I can get it working on the jquery file. However it seems to break on any plugin that uses this syntax: (function($) { ... } )(jQuery); Any thoughts or suggestions would help. This is a great feature that I would love to get working. Thanks, Dave
[jQuery] Re: Event Capture Architecture
Can't you give the elements the same class and bind the class with the click event?
[jQuery] Select a tricky image with jQuery.
I have some image on webpage: img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/first.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/second.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/third.gif/ I need to set an event listener only on the first image. - I think, $('.imagefield') is not a good solution, because set the event listener on all image. Is possible to set the event listener using the image name ? For example: first.gif ? Sorry I have a complicated situation, the html editing is not allowed at all. Somehow I need to select the first image with jquery. Thanks!
[jQuery] Tabs problem in IE
I have set up a tabbed section for different parts of my portfolio. It works great in Firefox, no problems, but when I try it in IE (I tired it in 7) it doesn't work at all. I'm a noob when it comes to JavaScript/jQuery (trying to learn though). Any ideas as to why would be appreciated. Check this out to see what I've got: http://413creativemedia.com/tab.html. Thanks in advance for the help.
[jQuery] Re: Select a tricky image with jQuery.
You can do $('.imagefield:eq(0)') to select first image out of all 'imagefield' George On Nov 12, 4:33 pm, yo2lux [EMAIL PROTECTED] wrote: I have some image on webpage: img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/first.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/second.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/third.gif/ I need to set an event listener only on the first image. - I think, $('.imagefield') is not a good solution, because set the event listener on all image. Is possible to set the event listener using the image name ? For example: first.gif ? Sorry I have a complicated situation, the html editing is not allowed at all. Somehow I need to select the first image with jquery. Thanks!
[jQuery] Re: serializing array of html elements using Jquery
You can use the makeArray function: http://docs.jquery.com/Utilities/jQuery.makeArray 2008/11/12 Tohin [EMAIL PROTECTED]: I am having a problem.. form input type='text' name='items[1][amount]' value='10' / input type='text' name='items[1][label]' value='10' / input type='text' name='items[2][amount]' value='10' / input type='text' name='items[2][label]' value='10' / /form i can access each elements using $('[name^=items').each().. But i want them as an array.. so that i can do some operation. Thanks in advance. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: selector to .wrap multiple elements in HTML
Karl, Thanks very much. My bad, but what I actually need is the div wrapped around each of the sets of h1,p,p. So, the resulting code must be: div class='fade' h1.../h1 p.../p p.../p /div div class='fade' h1.../h1 p.../p p.../p /div I have tried a number of different things, and this function works to wrap the first set of 3 in the div: $(#content h1:nth-child(1),#content p:nth-child(2),#content p:nth- child(3)).wrapAll(div class='fade'/div); so then I try to add another function to wrap the second set: $(#content h1:nth-child(4),#content p:nth-child(5),#content p:nth- child(6)).wrapAll(div class='fade'/div); but I think the 'nth's get fouled up once the first function runs and the results of adding the second function are very odd. Any thoughts? Thanks (again) Karl!! -Adam On Nov 12, 2:14 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Adam, Take a look at the .wrapAll() method. that should get you closer. You'll need to select all of the elements first, though. $('h1 + p + p') only selects that final p. If you want to wrap the div around all h1 and p elements, you could try $('h1,p').wrapAll('div class=fade/div'); --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Nov 12, 2008, at 2:11 PM, Adam wrote: I am trying to figure out how to select 3 elements that occur together and wrap all 3 together (not individually) in a DIV tag. This is what I have: h1.../h1 p.../p p.../p h1.../h1 p.../p p.../p and I want to turn that into: div class='fade' h1.../h1 p.../p p.../p h1.../h1 p.../p p.../p /div I have tried using the (h1 + p + p) with .wrap, but this seems to detect the trio, but only wrap the last p. How can I make it wrap the trio together? Thanks! -Adam
[jQuery] Re: Script to keep draggable windows in the main window not working?
Thank you for your response. Unfortunately that didn't solve the problem, nor did it bring any errors to error console. I believe both ways of doing that are valid, unless there is something in the code stopping it from getting there, in which case they might not work. Would it be possible that other code in the script is making this not work? Or is it most likely this script being screwy? On Nov 11, 11:41 pm, pd [EMAIL PROTECTED] wrote: I'm completely guessing but i think these lines might be the problem: newTop= window.height - $(this).outerHeight(); newLeft= window.width - $(this).outerWidth(); maybe try: newTop= $(window).height() - $ (this).outerHeight(); newLeft= $(window).width() - $(this).outerWidth (); Good luck pd On Nov 12, 1:24 pm, CodingCyborg [EMAIL PROTECTED] wrote: I have a script to keep the draggable windows from leaving the main window they are in. When I comment out the code everything else works perfectly. But if I allow this code to be included, not everything loads, the windows won't move, but nothing shows up in error console. jQuery(document).mousemove(function(){ $('.draggableWindow').each(function(){ if(parseInt($(this).css(top)) 0){ $(this).css(top, 0); } if(parseInt($(this).css(left)) 0){ $(this).css(left,0); } newTop= window.height - $(this).outerHeight(); newLeft= window.width - $(this).outerWidth(); if(parseInt($(this).css(top)) newTop){ $(this).css(top, newTop); } if(parseInt($(this).css(left)) newLeft){ $(this).css(left, newLeft); } } }); Not sure whats messing it up. I've tried changing a few parts of it to no prevail. Help is appreciated. -CodingCyborg
[jQuery] Re: conditional remote validation
About writing custom methods: http://docs.jquery.com/Plugins/Validation/Validator/addMethod Jörn On Wed, Nov 12, 2008 at 7:29 PM, spellingcity [EMAIL PROTECTED] wrote: In this particular case, for example: current email: [EMAIL PROTECTED] The field above (sample form field) should only validate the email address if it is different than the user's current email address of [EMAIL PROTECTED]. Where is the documentation for a custom method? In the meantime, I have worked around the issue by adding a link that says Change Email which than shows an empty email box which gets validated regardless of the email that is entered (even if they enter their own). This way its less confusing to the user, to enter a new email address they are required to click something which than shows them an empty box. If they enter the same email address as their own account, it will tell them that its already in use, but that's ok. Thanks On Nov 12, 5:12 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: How and where do you decide what is valid? Either do it on the serverside, in which case you don't have to modify the clientside logic. Or on the clientside, in this case a custom method that returns (instead of the usual true/false) just a string dependency-mismatch. That cancels all further validation for that field (same as required dependencies). Jörn On Tue, Nov 11, 2008 at 10:21 PM, spellingcity [EMAIL PROTECTED] wrote: There is a particular scenario where I don't want the remote validation to actually get executed. In particular, this is when you have a field, say a username field and the user is editing the field and the value of the field is their current username. This is considered a valid username and remote check shouldn't execute. Any suggestions? Thanks- Hide quoted text - - Show quoted text -
[jQuery] Re: can you simplify this selector? easy for you...
This is completely untested, but this is a bit simpler: $('#PG1_L03-table').find('td:eq(3), td:eq(5), td:eq(7), td:eq(9)').find('input').bind.. Rik 2008/11/12 ggerri [EMAIL PROTECTED]: Hi Gurus have the following selector and wonder how this could be simplified? :confused: $('#PG1_L03-table td:nth-child(3) input, #PG1_L03-table td:nth-child(5) input, #PG1_L03-table td:nth-child(7) input, #PG1_L03-table td:nth-child(9) input').bind.. need to bind an event to all input fields of col 3, 5, 7 and 9 but only for table PG1_L03-table. Any help appreciated :handshake: -- View this message in context: http://www.nabble.com/can-you-simplify-this-selector--easy-for-you...-tp20459678s27240p20459678.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- Rik Lomas http://rikrikrik.com
[jQuery] Re: pirobox plugin released
Hi Shawn, you 'r right, spaces make the script more readable, i'm going to leave, for the unpacked version, the original script. tnx for your advices. Diego On 12 Nov, 02:26, Shawn Grover [EMAIL PROTECTED] wrote: I'd think that leaving the spaces and such in there make it more readable. And the more readable, the more reusable the code is by others. If you really want lightweight, then minimize or pack the library and use that version. But the developer version should be as developer friendly as possible... Of course this is just my opinion, and you are free to do as you wish.. :) Shawn diego wrote: You mean thishttp://www.pirolab.it/pirobox/js/pirobox.js?? unreadable? I changed all the original variables and removed all the spaces to get the script more lightweight. Just this :) On 12 Nov, 01:47, Isaak Malik [EMAIL PROTECTED] wrote: I just peeked at the source code and I'm wondering if this is the original version? It's quite unreadable. And of course, copyright notice will be kept untouched On Wed, Nov 12, 2008 at 1:43 AM, diego [EMAIL PROTECTED] wrote: This is great, the only thing i ask, is to leave my name up there in the js, and if you want, a link back to my page :) Diego On 12 Nov, 01:38, Isaak Malik [EMAIL PROTECTED] wrote: Oh, I didn't see the unpacked version and it was right under it... Thanks :) I may use this in a current project after some testing :) On Wed, Nov 12, 2008 at 1:34 AM, diego [EMAIL PROTECTED] wrote: Hi Isaak,i really hate explorer i work with firefox, for debug my script,and when i open explorer i'm really scared of what can happen.. sure that is open source, you can download both version, packed and unpacked,just click the anchor 'download' on the nav. Diego On 12 Nov, 01:27, Isaak Malik [EMAIL PROTECTED] wrote: It doesn't sound strange at all, we can expect anything from IE ;) It is very interesting indeed but what about the license + source code? Is this an opensource library, if so can you also provide a non-packed version? On Wed, Nov 12, 2008 at 1:13 AM, diego [EMAIL PROTECTED] wrote: Hi Isaak, i've tested it in ie6/7, ff2/3 , safari mac/pc , opera 9.5/9.6 , G. chrome, and the only problem i found it's with ie7,the animation is not as smooth as in firefox, it may sound strange but it works better with IE6, and not with ie7. It's ok in opera safari e chrome. The best performance is obviously in firefox, then chrome, safari, opera, IE6, and last ie7. Diego On 12 Nov, 00:59, Isaak Malik [EMAIL PROTECTED] wrote: Very interesting piece of work :), have you performed cross-browser tests? On Wed, Nov 12, 2008 at 12:55 AM, diego [EMAIL PROTECTED] wrote: Hi all, i've finished my first plugin, hope you like it, any question or opinion it's welcome. http://www.pirolab.it/pirobox/ I developed this plugin, by studying the docs.jquery, it's amazing what you can do with this library. Tnx to all the jquery developers. Diego Valobra -- Isaak Malik Web Developer -- Isaak Malik Web Developer -- Isaak Malik Web Developer -- Isaak Malik Web Developer
[jQuery] Re: Select a tricky image with jQuery.
By the way is possible to set an event listener using the title attribute ? I think is possible for me to set title=first in html On Nov 12, 11:47 pm, yo2lux [EMAIL PROTECTED] wrote: The situation is a bit complicated. I don't see each image on page. I have the first image on contact page. :( So .imagefield:eq(0) is not a good solution On Nov 12, 11:36 pm, George [EMAIL PROTECTED] wrote: You can do $('.imagefield:eq(0)') to select first image out of all 'imagefield' George On Nov 12, 4:33 pm, yo2lux [EMAIL PROTECTED] wrote: I have some image on webpage: img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/first.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/second.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/third.gif/ I need to set an event listener only on the first image. - I think, $('.imagefield') is not a good solution, because set the event listener on all image. Is possible to set the event listener using the image name ? For example: first.gif ? Sorry I have a complicated situation, the html editing is not allowed at all. Somehow I need to select the first image with jquery. Thanks!
[jQuery] Re: Select a tricky image with jQuery.
This could be a poor html design issue and I would try to change it to start. But if you are stuck with what you have you can try something like this: $(img[src$='first.gif']); For more info check out: http://docs.jquery.com/Selectors This is untested as always. Good luck Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of yo2lux Sent: Wednesday, November 12, 2008 1:33 PM To: jQuery (English) Subject: [jQuery] Select a tricky image with jQuery. I have some image on webpage: img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/first.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/second.gif/ img class=imagefield height=310 width=310 title= alt= src=/ sites/default/files/third.gif/ I need to set an event listener only on the first image. - I think, $('.imagefield') is not a good solution, because set the event listener on all image. Is possible to set the event listener using the image name ? For example: first.gif ? Sorry I have a complicated situation, the html editing is not allowed at all. Somehow I need to select the first image with jquery. Thanks!