[jQuery] Re: UPDATER
On Feb 5, 2008, at 1:16 AM, [EMAIL PROTECTED] wrote: Is there any function like AJAX.UPDATER in Prototype ?? Or how can I automaticly do AJAX.req in time interval for.ex. 2 minutes ? Is there a need for plugin? Warning untested code, but you will get the idea. setInterval( $(#some_div).load(http://www.example.com/some_content.html , 2000) ); -- Mika Tuupola http://www.appelsiini.net/
[jQuery] [Validate] Two fields, one error message
Hi all, Hoping (and betting) that this is a simple fix but I have two fields - the month and year of a card expiry date. Both of them need to have a selection made, but I only want to show ONE error message if EITHER of them are left blank. At the moment, if both fields are left blank, two error messages appear underneath the boxes. Is there a way to tie both fields together so only one message is displayed? Regards, Michael Price
[jQuery] Re: jquery newbie test
finaly I am not alone anymore ;-) On Feb 5, 2:15 am, Josh Nathanson [EMAIL PROTECTED] wrote: Access...confirmed. =] - Original Message - From: CFMike To: jquery-en@googlegroups.com Sent: Monday, February 04, 2008 4:00 PM Subject: [jQuery] jquery newbie test Please ignore. I am new to the jquery list. I am just testing my access. Thank you for your patience.
[jQuery] Handling events on remotely loaded html code
Hi guys, I have this code where it will dynamically load the html code coming from a remote url but when I created an event for this html code. Jquery doesn't recognize the elements coming from this html code. What should I do for jquery to execute the click event p id=contentsTest/p? Thanks Here's the snippet ## Html source: div id=show_box_container /div a href=javascript:show_box('xxx'); class=actionsShow/a ## Javascript with jquery: function show_box(name) { $.ajax({ url: 'remote_test.html', timeout: 5000, success: function(html, textStatus, data){ $('div#show_box_container').append(html); }, async: false }); } $(document).ready(function(){ $(p#contents).click(function(){ alert(test); }) }); ## HTML Source after loading page under firebug html head script src=jquery-1.2.1.js type=text/javascript/script script type=text/javascript function show_box(name) { $.ajax({ url: 'remote_test.html', timeout: 5000, success: function(html, textStatus, data){ $('div#show_box_container').append(html); }, async: false }); } $(document).ready(function(){ $(p#contents).click(function(){ alert(test); }) }); /script /head body div id=show_box_container p id=contentsTest/p /div a class=actions href=javascript:show_box('xxx');Show/a /body /html
[jQuery] Re: jCarousel - How do I hide the list before display
Couldn't you just use a visibility:hidden; style in your css? Or maybe put it into your jquery so the list is only hidden if you have javascript enabled. On Feb 5, 2:12 am, rich [EMAIL PROTECTED] wrote: Ah, ok. I thought you were looking to hide that quick flash of the image list before they 'stack' up. On Feb 4, 3:01 pm, caroig [EMAIL PROTECTED] wrote: Ok thank Rich - I'll give that a try - I'd hoped I could hide it all until it's built. On Feb 4, 4:23 pm, rich [EMAIL PROTECTED] wrote: I had this problem once before. I ended setting a fixed height on the parent div and setting overflow:hidden. -rich On Feb 4, 8:03 am, caroig [EMAIL PROTECTED] wrote: Hi, Is there a way of hiding the list before the carousel is fully generated. I often get to see the list of images before the carousel effect is produced. I've tried setting display to none in my css and then executing jQuery .show after the carousel, but seems doesn't work well. many thanks
[jQuery] Re: Zebra striping in tables
Karl, Thank you! This is what I was looking for! Karl Swedberg schreef: One way to solve your dilemma is to use tr:nth-child(even). That will select all table rows that are an even child of their parent element. This should work: $(table tr:nth-child(even)).css(background, #cc); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 4, 2008, at 5:38 PM, Snef wrote: Hi, I know how to do some 'zebra-striping' on tables with jQ, but i have a little problem. I have some (unknown amount) tables om a page and I want to 'stripe' the tables seperately, so that all striping is the same in each table. With a simple: $(table tr:even).css(background, #cc) the rows are counted over all the tables and I want to start counting (for even and odd rows) for every table, so i tought: $(table).each(function() { // how to get the rows here??? }) How do I do this? (I do not know on forehand how many or which tables are on the page)
[jQuery] Re: Zebra striping in tables
Karl, Again, many thanks. Only just one question... I have used your one-liner like this: $(table tr:nth-child(even)).css(background, #cc); I played around with the :not(:first) to eliminate the first row of each table but i do not get it working. Is this possible to use this, or is it better to just change all the firstrows after yoour one- liner? (at the end, i can use a special classname for the first row, but I'm curious to know if it can work without it!) Karl Swedberg schreef: One way to solve your dilemma is to use tr:nth-child(even). That will select all table rows that are an even child of their parent element. This should work: $(table tr:nth-child(even)).css(background, #cc); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 4, 2008, at 5:38 PM, Snef wrote: Hi, I know how to do some 'zebra-striping' on tables with jQ, but i have a little problem. I have some (unknown amount) tables om a page and I want to 'stripe' the tables seperately, so that all striping is the same in each table. With a simple: $(table tr:even).css(background, #cc) the rows are counted over all the tables and I want to start counting (for even and odd rows) for every table, so i tought: $(table).each(function() { // how to get the rows here??? }) How do I do this? (I do not know on forehand how many or which tables are on the page)
[jQuery] Submting html form does not work in ie explorer
Hi, I have two jsp pages. In one I create a form: form id=uaForm action=basic.jsp method=post ... /form I have bound this form to ajaxForm $('#uaForm').ajaxForm({ target: '#htmlChartTarget', success: function() { $('#htmlChartTarget').fadeIn('slow'); } }); Now when the first form is submitted to the basic.jsp its (html) response along with some js code returned are displayed in htmlChartTarget div. The js code is also executed. This works absolutely fine in firefox. The same when I run in ie explorer it does not work fine. Only part page is displayed (ie only the html content) The js code is not executed under the script tag. The part js code under script tag of basic.jsp is: $(function() { $('[EMAIL PROTECTED]').addClass('field'); $('select').addClass('fieldSelect'); addColorOptions(); addChartOptions(); $('#drawbutton').click(drawChart); drawChart(); }); even if I add an alert as first statement its not executed and also I get no error on my browser. Please help. Thanks Sachin - http://www.assembla.com/wiki/show/sachin_mittal about me: -- View this message in context: http://www.nabble.com/Submting-html-form-does-not-work-in-ie-explorer-tp15286256s27240p15286256.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Zebra striping in tables
Allex, This is what I was thinking of but couldn't get my hands on the 'find'. Your solutions works, but I think I go for Karls solution (a one- liner). Thank you! Smith, Allex schreef: Couldn't you just use $(this) and then do whatever selector? $(table).each(function() { $(this).find('tr:even').css(background-color, #ff); }); Maybe I don't understand the question. Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Snef Sent: Monday, February 04, 2008 2:38 PM To: jQuery (English) Subject: [jQuery] Zebra striping in tables Hi, I know how to do some 'zebra-striping' on tables with jQ, but i have a little problem. I have some (unknown amount) tables om a page and I want to 'stripe' the tables seperately, so that all striping is the same in each table. With a simple: $(table tr:even).css(background, #cc) the rows are counted over all the tables and I want to start counting (for even and odd rows) for every table, so i tought: $(table).each(function() { // how to get the rows here??? }) How do I do this? (I do not know on forehand how many or which tables are on the page)
[jQuery] Re: jquery newbie test
Josh and Aaron- Thanks On Feb 4, 5:15 pm, Josh Nathanson [EMAIL PROTECTED] wrote: Access...confirmed. =] - Original Message - From: CFMike To: jquery-en@googlegroups.com Sent: Monday, February 04, 2008 4:00 PM Subject: [jQuery] jquery newbie test Please ignore. I am new to the jquery list. I am just testing my access. Thank you for your patience.
[jQuery] Re: Firefox: how to center the selected text in textarea
On Feb 1, 10:29 pm, Ariel Flesler [EMAIL PROTECTED] wrote: Hi lihao Is there any method under Firefox that the caret and the selected text can automatically jump to the center of the textarea so that people dont need to scroll down/up to find it?? Not that I know of, but you could force the scroll with jQuery, if you want, this plugin can save you some troubles: jQuery.ScrollTo:http://flesler.blogspot.com/2007/10/jqueryscrollto.html Is the textarea bigger than a regular screen ? ( 600px ? ) If it's not, you could just center the screen on the textarea. If it's even bigger, then you need some implement some sort of wise scrolling, based in the position of the caret Hi, Ariel: The textarea is '550px' in my application, so I guess I actually need to count the 'px' from the top and left of the textarea borders. so I need to find a way to roughly compute these two numbers by using the width of the textarea, number of newlines before the current position and the font-size.. Is there any better approach to do this with scroll-To within a textarea element? :-) Many thanks, lihao(XC)
[jQuery] scrollTo Firefox
Hey all, somewhat new to jQuery.. glad to have found this group, hope to be involved and help out when I can. Trying out the scrollTo plugin at www.stirman.net... just some dummy data there now. Everything is working great in Safari, but in FF, the scrollTo links don't work at all? Is there something I am missing? (scrollTo: http://plugins.jquery.com/project/ScrollTo) Thanks! -Stirman
[jQuery] PHP and ajaxForm submit generates duplicate HTML!
First, here is my code for test.php file. It has a form with 2 text fields. Once submitted it adds a record to database and gives a message 1 record added. in a div message : ?php require_once('Connections/local.php'); ? head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script type=text/javascript src=js/jquery.js/script script type=text/javascript src=js/jquery.form.js/script script type=text/javascript $(document).ready(function() { $('#form1').ajaxForm({ target: '#message', success: function(){$ ('#message').fadeIn('slow');} }); }); /script /head body ?php if (!isset($_POST['submit'])) { ? div id=form form id=form1 action=?php $_SERVER['PHP_SELF']; ? method=post name=form1 input id=email name=email type=text / input name=password type=text / input class=submit name=submit type=submit value=submit / /form /div ?php } else { $email =$_POST['email']; $pass =$_POST['password']; mysql_select_db(iupgbsa_gbsa, $local); $sql = INSERT INTO tempdb (email, password) VALUES ('$email', '$pass'); if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } $msg = 1 record added.; } ? div id=message ?php echo $msg; ? /div /body /html The problem is, every time I add a new record the message div fills up with a new line 1 record added. and if I check the source code, inside message' there is another message created. So if I add 10 records, original message div fills up with 10 more same div and therefore 10 lines of 1 record added.. Eventually the file size increases. How do I solve this problem? I'm new to JQuery. Please help!
[jQuery] Submting html form does not work in ie explorer
Hi, I am having some problem with the form plugin: jquery.form.js, may be related to general issue with jquery itself. I have two jsp pages. In one I create a form: form id=uaForm action=basic.jsp method=post ... /form I have bound this form to ajaxForm $('#uaForm').ajaxForm({ target: '#htmlChartTarget', success: function() { $('#htmlChartTarget').fadeIn('slow'); } }); Now when the first form is submitted to the basic.jsp its (html) response along with some js code returned are displayed in htmlChartTarget div. The js code is also executed. This works absolutely fine in firefox. The same when I run in ie explorer it does not work fine. Only part page is displayed (ie only the html content) The js code is not executed under the script tag. The part js code under script tag of basic.jsp is: $(function() { $('[EMAIL PROTECTED]').addClass('field'); $('select').addClass('fieldSelect'); addColorOptions(); addChartOptions(); $('#drawbutton').click(drawChart); drawChart(); }); even if I add an alert as first statement its not executed and also I get no error on my browser. Please help. Thanks Sachin
[jQuery] Computing value for css key
Hi! I'm trying to position a div, #lt, absolutely in relation to another div (#content), and subtract 24px so that div#lt.left = div#content.left - 24px: $(div#lt).css(left, eval(parseInt($ (div#content).css(left))-24)); The problem is, I can't get it to happen. I've tried a lot of different ways, including the above, but might have missed an obvious one? Thanks!
[jQuery] [validate] use of [] for the name and id of the form input
Hello, I have to use [] in the name and the id of the inout of my form. For example, I use this syntax: input id=tx_dmmjobcontrol_pi1[apply][city] type=text class=textCity name=tx_dmmjobcontrol_pi1[apply][city] / And in the jqurey : tx_dmmjobcontrol_pi1[apply][city]: { required: true, }, On firefox, the validation is ok. But the script doesnt work on IE. I have an error cause of the utilisation of ... but if i dont use the , the [] are causing problems and i have to use them. Is there a solution to use name and id with [ ] and to make work the script on Internet Explorer ? Thanks you for your help !
[jQuery] Re: JQuery takes 80% of my core2Duo proc on DOM element inserts
I think it's generally proven that inserting dom objects is much slower than innerHTML, for the kind of inserting you're trying, that might be worth investigating... On Feb 4, 1:57 pm, Ashish [EMAIL PROTECTED] wrote: Hi , I am very new to jquery. I am using jquery 1.2.2 . I use jquery tablesorter to insert around 400 rows to a table. The data is collected using an Ajax call. When new rows are inserted to the table the CPU utilization shoots up to 80%. All browsers freeze until the table is populated :( I tried to insert 400 divs to a single div and faced the same problem. This rules out a problem with tablesorter. Does jquery attach a lot of handlers to dom events that make appends very slow ? Any suggestions would be much appreciated. Thanks and regards, - Ashish
[jQuery] Re: animate calculates wrong duration with linebreaks?
I got this problem as well. Nothing seems to help, no css changes nor changing the lis to divs. Any ideas? On Feb 1, 9:10 pm, lgr888999 [EMAIL PROTECTED] wrote: http://paste.css-standards.org/31399/view Checkout the slide out of Ice Hockey orTennis. Seems like the duration is calculated wrong when there are linebreaks? The funny part about it is that the slide up works fine. To me, this occur on both firefox 2 and safari 3. Is it a jquery bug? is it a DOM-issue? Tried with jquery 1.2.3a aswellsame issue. Thanks in advance.
[jQuery] Re: PHP and ajaxForm submit generates duplicate HTML!
script type=text/javascript $(document).ready(function() { $('#form1').ajaxForm({ target: '#message', success: function(){$ ('#message').fadeIn('slow');} }); }); /script div id=message ?php echo $msg; ? /div /body /html The problem is, every time I add a new record the message div fills up with a new line 1 record added. and if I check the source code, inside message' there is another message created. So if I add 10 records, original message div fills up with 10 more same div and therefore 10 lines of 1 record added.. Eventually the file size increases. How do I solve this problem? I'm new to JQuery. Please help! 'target' identifies the element to which the server response will be set as the HTML. It is not an element that is replaced itself, it is an element whose content is replaced. In your case you keep returning a new message div, and so they keep nesting. Try starting with an empty #message div in your markup and then have the server return just the message text when the form is submitted. Mike
[jQuery] getting element number?
$('#' + self.options.auto_complete_id + ' li').bind('mouseover', function() { //code }); now is there a way i can get the element number of the one my mouse is currently over? I mean lets say there is 10 li's in that list and my mouse is over the 4th one, is there a easy way to get the number 3(since javascript 0 is the first and so on)? -- View this message in context: http://www.nabble.com/getting-element-number--tp15289891s27240p15289891.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Zebra striping in tables
On Feb 5, 7:57 pm, Snef [EMAIL PROTECTED] wrote: Karl, Again, many thanks. Only just one question... I have used your one-liner like this: $(table tr:nth-child(even)).css(background, #cc); I played around with the :not(:first) to eliminate the first row of each table but i do not get it working. Is this possible to use this, or is it better to just change all the firstrows after yoour one- liner? (at the end, i can use a special classname for the first row, but I'm curious to know if it can work without it!) Consider putting your header rows in a thead element, then use: $(tbody ... -- Rob
[jQuery] Re: Firefox: how to center the selected text in textarea
Hi Lihao, I assume 550 is width and height so it's a squared textarea. IMO 550 fits on any screen ( fits on 800x600 ). You could simply scroll to the textarea and leave a gap below. You could add a margin to the textarea and set the option 'margin' to true, will it stop when it reaches the margin. The hard way would be: var $textarea = $('textarea');//this you need to customize var gap = ($(window).height() - $textarea.height()) / 2;//this is the margin on top $.scrollTo( $textarea, 1000, { offset: -gap }); That is if you only scroll vertically, else you need to calculate both gaps and use: $.scrollTo( $textarea, 1000, { offset:{ top:-gap1, left:-gap2 }} ); If you really want to scroll based on the caret position, you need to count the lines with a regex, looking for \n or /^/m. I don't think you need to involve font-size. Textareas have a property named 'rows'. So to keep it easy, if you specified 55 rows, and the height is 550, then each row is 10px. So you count the rows and voila! ( I think :) ). So well.. give this a try, let me know if this doesn't do what you need. Cheers Ariel Flesler On 5 feb, 07:06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Feb 1, 10:29 pm, Ariel Flesler [EMAIL PROTECTED] wrote: Hi lihao Is there any method under Firefox that the caret and the selected text can automatically jump to the center of the textarea so that people dont need to scroll down/up to find it?? Not that I know of, but you could force the scroll with jQuery, if you want, this plugin can save you some troubles: jQuery.ScrollTo:http://flesler.blogspot.com/2007/10/jqueryscrollto.html Is the textarea bigger than a regular screen ? ( 600px ? ) If it's not, you could just center the screen on the textarea. If it's even bigger, then you need some implement some sort of wise scrolling, based in the position of the caret Hi, Ariel: The textarea is '550px' in my application, so I guess I actually need to count the 'px' from the top and left of the textarea borders. so I need to find a way to roughly compute these two numbers by using the width of the textarea, number of newlines before the current position and the font-size.. Is there any better approach to do this with scroll-To within a textarea element? :-) Many thanks, lihao(XC)
[jQuery] Re: dynamic classes
Can you use the :nth() selector ? Are the buttons next to the list items? If so could you just find the form that is next to the button? Eg: $(this).next(FORM) On Feb 5, 2:12 am, jg [EMAIL PROTECTED] wrote: Hope that makes sense. Any thoughts?
[jQuery] Re: AJAX file management
How much time did you spend searching for a free version? Did that cover the $289? On Jan 29, 8:39 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks for the link. I notice this goes for $289 for a commercial license. Know anything that's freeware? - Dave
[jQuery] Wordpress: Get post using Jquery
Hello Everyone! I would like to retrieve Wordpress posts/pages etc. without page reload (ajax loading) using Jquery, though I don`t know how to implement this in Wordpress. Basically, I would like the post/page to be output into a div layer, without page reload. How can this be achieved? If the back/forward browser buttons could still work, that would be extra-wonderful (I have seen it working on other ajax sites). Anyone know how to do this, or has a link to a good/easy tutorial? Thanks for your reply! -- View this message in context: http://www.nabble.com/Wordpress%3A-Get-post-using-Jquery-tp15253840s27240p15253840.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Wordpress: Get post using Jquery
http://extjswordpress.net/ no more needed :-) micha
[jQuery] [UI.TABS] - Problem with nested tabs
I've created the nested tab structure and it does its initial display just fine. I'm having problems with displaying remotely generated content within a region of one of the nested tabs. The region is defined as a DIV and I've double-checked the naming throughout. The remote content is being generated from a form search. I use the FORM plugin for that. This method works fine for me on non-nested tabs. In the nested tab, the content is opened in a new window instead of the region within the nested tab. Is there anything out of th ordinary that I should be aware of and looking for? Is nesting tabs not a good idea? TIA
[jQuery] Re: Problems with $(document).height() and jQuery 1.2.2
Have you checked $(document.body).height()? On Feb 4, 10:21 am, rich [EMAIL PROTECTED] wrote: On most of my projects I have some js to push the footer to the bottom on pages with little/no content (compares document height and viewport height). When I upgraded to jQuery 1.2.2 it stopped working. It seems like I'm getting unexpected results from $(document).height(). Am I missing something (newer syntax perhaps?), or is this a bug of some sort? Testing on the same page: jQuery 1.2.1 (packed) -- This is how it should be: IE (v6.0.2900.2180.xpsp_sp2_gdr.070227-2254) $(document).height(): 423 $(window).height(): 613 Firefox (2.0.0.11) $(document).height(): 405 $(window).height(): 609 jQuery 1.2.2 (packed): IE $(document).height(): 617 $(window).height(): 613 Firefox $(document).height(): 609 $(window).height(): 609 Thanks guys, -rich
[jQuery] Re: scrollTo Firefox
I think the problem is that you are not preventing the # from appearing in the url, that generates some sort of default scroll, I'd bind those onclicks in a non-obstrusive way, try this: script type=text/javascript jQuery(function( $ ) $.scrollTo.defaults.axis = 'x';//so we don't need to specify each time. var $links = $('div.move_link a');//the 3 links $links.eq(0).click(function(){//left $.scrollTo( '-=900', 300 ); return false;//don't let that # appear on the url }); $links.eq(1).click(function(){//right $.scrollTo( '+=900', 300 ); return false; }); $links.eq(2).click(function(){//current $.scrollTo( 4000, 300 ); return false; }); }); /script That's it. If you want a smaller, cooler way: script type=text/javascript jQuery(function( $ ) var positions = [ '-=900', '+=900', 4000 ];//the scroll positions of each link var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this ? 0, 1 or 2 ? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url }); }); /script I hope it works well for you. Cheers Ariel Flesler On 5 feb, 03:18, stirman [EMAIL PROTECTED] wrote: Hey all, somewhat new to jQuery.. glad to have found this group, hope to be involved and help out when I can. Trying out the scrollTo plugin atwww.stirman.net... just some dummy data there now. Everything is working great in Safari, but in FF, the scrollTo links don't work at all? Is there something I am missing? (scrollTo:http://plugins.jquery.com/project/ScrollTo) Thanks! -Stirman
[jQuery] reusing jqmodal container
my script $('a#corregir_jqm_trigger').click(function(){ $('#jqm').jqm({ajax: this.href, trigger: '#corregir_jqm_trigger', modal: 'true', target:'div.jqmAlertContent', overlay: 50, overlayClass: 'whiteOverlay', cache: false, onLoad: preparar_corregir_form}).jqmShow().jqDrag('.jqDrag'); $('.jqmdTC').html('Enviar correccioacute;n de la paacute;gina:'); jqm_windows(); return false; }); $('a#enviar_jqm_trigger').click(function(){ $('#jqm').jqm({ajax: this.href, trigger: '#enviar_jqm_trigger', modal: 'true', target:'div.jqmAlertContent', overlay: 50, overlayClass: 'whiteOverlay', cache: false, onLoad: preparar_envio_form}).jqmShow().jqDrag('.jqDrag'); $('.jqmdTC').html('Enviar esta noticia por email'); jqm_windows(); return false; }); use the same jqm container, i pass the windows title via $('.jqmdTC').html, but if i click in the first link and then in the second the second allways showme the first ajax response. And im calling other thing! how i can fix this?
[jQuery] Re: getting element number?
$('#' + self.options.auto_complete_id + ' li').bind( 'mouseover', function() { $this = this; $(this).parent().children().each( function( i ) { if ( $this == this ) { alert( i + 1 ); } }); }); On Feb 5, 8:15 am, Eridius [EMAIL PROTECTED] wrote: $('#' + self.options.auto_complete_id + ' li').bind('mouseover', function() { //code }); now is there a way i can get the element number of the one my mouse is currently over? I mean lets say there is 10 li's in that list and my mouse is over the 4th one, is there a easy way to get the number 3(since javascript 0 is the first and so on)? -- View this message in context:http://www.nabble.com/getting-element-number--tp15289891s27240p152898... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Most basic of basic fundamental questions.
I'm reading 'learning jQuery'. In this example, and in fact every example, why do you pass a function as an argument. $(document).ready(function() { $('.poem-stanza').addClass('emphasized'); }); why can't I do this? $(document).ready( $('.poem-stanza').addClass('emphasized'); ); Thanks. I'm asking this a learning exercise, so I apologize in advance for the apparent stupidity of it.
[jQuery] Re: Repeating last AJAX action
when you do the original ajax action, you need to store the variables about the search somewhere (global variable, cookie, somewhere in the document) such that when you do the customer type change, it can get those values and pass them back to the original ajax search function, making sure to tell it the new customer type --adam On Feb 5, 9:39 am, Michael Price [EMAIL PROTECTED] wrote: Hi all, Another little query requiring assistance :) I've got an AJAX search form - you type in a search keyword, underneath the box you get a list of matches and prices. There are also other AJAX forms for searching by category, drilling down through a category tree, and searching by series of books - meaning the source of the search results can be one of a few different searches. The prices differ according to what sort of customer you've said you are in another dropdown (there's a trade discount scheme, basically). If a customer performs a search, they see one set of prices - if they then change their customer type I'd like to re-execute the last search, and redisplay the results with the new price. What are people's recommendations on the best way to go about doing this? As ever, all help gratefully received :) Regards, Michael Price
[jQuery] Re: getting element number?
Hi Eridius, I guess this could do it: $('#' + self.options.auto_complete_id + ' li').each(function(i) { // i is now an index $(this).bind('mouseover', function() { //do something on mouseover }); }); -- Bohdan Ganicky On Feb 5, 2:15 pm, Eridius [EMAIL PROTECTED] wrote: $('#' + self.options.auto_complete_id + ' li').bind('mouseover', function() { //code }); now is there a way i can get the element number of the one my mouse is currently over? I mean lets say there is 10 li's in that list and my mouse is over the 4th one, is there a easy way to get the number 3(since javascript 0 is the first and so on)? -- View this message in context:http://www.nabble.com/getting-element-number--tp15289891s27240p152898... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Problems with $(document).height() and jQuery 1.2.2
Perfect. That fixes it. Thanks Scott On Feb 5, 9:03 am, Scott González [EMAIL PROTECTED] wrote: Have you checked $(document.body).height()? On Feb 4, 10:21 am, rich [EMAIL PROTECTED] wrote: On most of my projects I have some js to push the footer to the bottom on pages with little/no content (compares document height and viewport height). When I upgraded to jQuery 1.2.2 it stopped working. It seems like I'm getting unexpected results from $(document).height(). Am I missing something (newer syntax perhaps?), or is this a bug of some sort? Testing on the same page: jQuery 1.2.1 (packed) -- This is how it should be: IE (v6.0.2900.2180.xpsp_sp2_gdr.070227-2254) $(document).height(): 423 $(window).height(): 613 Firefox (2.0.0.11) $(document).height(): 405 $(window).height(): 609 jQuery 1.2.2 (packed): IE $(document).height(): 617 $(window).height(): 613 Firefox $(document).height(): 609 $(window).height(): 609 Thanks guys, -rich
[jQuery] Re: getting element number?
untested but something like this should work using closure: $('#' + self.options.auto_complete_id + ' li').each(function (i) { $(this).bind('mouseover', function() { if (i == 3) { //code } }); }); David
[jQuery] Adding a callback function to a extended jquery function
Hello, I have the following function: // Show and fade out a feedback message $.fn.addFeedback = function(feedbackMessage){ var offset = $(this).offset(); var feedbackDiv = div class='feedback' id='feedbackElement' style='display:none;position:absolute;left: + offset.left + px;top: + ( offset.top + 0) +px'p + feedbackMessage + /p/div; $(body).append(feedbackDiv); $('#feedbackElement').fadeIn('slow'); setTimeout($('#feedbackElement').fadeOut('slow', function(){$('#feedbackElement').remove();});,3000); } How do I change this to add an optional callback function to operate once the function has completed? Thanks, Dan. -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog
[jQuery] Re: - Problem with nested tabs
It is almost always useful if you post *relevant* code for these kind of problems. Otherwise we can only guess or have to spend some time on writing a reply asking you for such code ;-) (By relevant I mean not to simply dump 400 lines of HTML + JavaScript source code in here...) There's nothing wrong with nested tabs. So I'm guessing now: Is there a JavaScript error on the page? Does the form have a target attribute set to something? Some extra handlers attached to the form? Do you use some 3rd party libraries? --Klaus On Feb 5, 2:50 pm, carvingcode [EMAIL PROTECTED] wrote: I've created the nested tab structure and it does its initial display just fine. I'm having problems with displaying remotely generated content within a region of one of the nested tabs. The region is defined as a DIV and I've double-checked the naming throughout. The remote content is being generated from a form search. I use the FORM plugin for that. This method works fine for me on non-nested tabs. In the nested tab, the content is opened in a new window instead of the region within the nested tab. Is there anything out of th ordinary that I should be aware of and looking for? Is nesting tabs not a good idea? TIA
[jQuery] Repeating last AJAX action
Hi all, Another little query requiring assistance :) I've got an AJAX search form - you type in a search keyword, underneath the box you get a list of matches and prices. There are also other AJAX forms for searching by category, drilling down through a category tree, and searching by series of books - meaning the source of the search results can be one of a few different searches. The prices differ according to what sort of customer you've said you are in another dropdown (there's a trade discount scheme, basically). If a customer performs a search, they see one set of prices - if they then change their customer type I'd like to re-execute the last search, and redisplay the results with the new price. What are people's recommendations on the best way to go about doing this? As ever, all help gratefully received :) Regards, Michael Price
[jQuery] looking for a certain type of plug-in(example included)
http://sidekick.com/ I am basically looking for a plug-in that does what the bottom does. I thought i already saw one but can't seem to find anything and that plug-in uses mootools and i really don't want to use mootools and jquery. -- View this message in context: http://www.nabble.com/looking-for-a-certain-type-of-plug-in%28example-included%29-tp15291430s27240p15291430.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Zebra striping in tables
Rob definitely has the best answer here. Structure your table like so: table captionCaptions are good/caption thead tr thheader/th throw/th /tr /thead tfoot tr tdfooter/td tdrow/td /tr /tfoot tbody tr tdrow/td tdone/td /tr tr tdrow/td tdtwo/td /tr /tbody /table Then you don't have to worry about the checking for the first row and it will not be part of your structure. Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of RobG Sent: Tuesday, February 05, 2008 5:06 AM To: jQuery (English) Subject: [jQuery] Re: Zebra striping in tables On Feb 5, 7:57 pm, Snef [EMAIL PROTECTED] wrote: Karl, Again, many thanks. Only just one question... I have used your one-liner like this: $(table tr:nth-child(even)).css(background, #cc); I played around with the :not(:first) to eliminate the first row of each table but i do not get it working. Is this possible to use this, or is it better to just change all the firstrows after yoour one- liner? (at the end, i can use a special classname for the first row, but I'm curious to know if it can work without it!) Consider putting your header rows in a thead element, then use: $(tbody ... -- Rob
[jQuery] Re: Adding a callback function to a extended jquery function
I haven't writen a plugn that does this but something like: $.fn.addFeedback = function(feedbackMessage, callback ){ ... if(jQuery.isFunction(callback) callback.apply($(this)); ?? Someone with better plugin-fu could probably tell me how that's all wrong. Also, you might need to deal with timing issues if you want to make sure the callback is run only after the animations / setTimeout complete. Scott On Feb 5, 2008 10:35 AM, Dan Eastwell [EMAIL PROTECTED] wrote: Hello, I have the following function: // Show and fade out a feedback message $.fn.addFeedback = function(feedbackMessage){ var offset = $(this).offset(); var feedbackDiv = div class='feedback' id='feedbackElement' style='display:none;position:absolute;left: + offset.left + px;top: + (offset.top + 0) +px'p + feedbackMessage + /p/div; $(body).append(feedbackDiv); $('#feedbackElement').fadeIn('slow'); setTimeout($('#feedbackElement').fadeOut('slow', function(){$('#feedbackElement').remove();});,3000); } How do I change this to add an optional callback function to operate once the function has completed? Thanks, Dan. -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog -- -- Scott Trudeau scott.trudeau AT gmail DOT com http://sstrudeau.com/ AIM: sodthestreets
[jQuery] Re: Adding a callback function to a extended jquery function
Thanks, Scott, You're right, I'll have a look at this - I'm still really something of a beginner here! And you're right about the timing, too, I'd want the callback function to only start when the animation ends, or better, when it's about to end, so any transition is fairly seamless. I guess I also need to make it fairly robust in case there is more than one instance of the feedback panel on the page at any one time - 3 seconds is enough time to invoke several...! Thanks, Dan. On 2/5/08, Scott Trudeau [EMAIL PROTECTED] wrote: I haven't writen a plugn that does this but something like: $.fn.addFeedback = function(feedbackMessage, callback ){ ... if(jQuery.isFunction(callback) callback.apply($(this)); ?? Someone with better plugin-fu could probably tell me how that's all wrong. Also, you might need to deal with timing issues if you want to make sure the callback is run only after the animations / setTimeout complete. Scott On Feb 5, 2008 10:35 AM, Dan Eastwell [EMAIL PROTECTED] wrote: Hello, I have the following function: // Show and fade out a feedback message $.fn.addFeedback = function(feedbackMessage){ var offset = $(this).offset(); var feedbackDiv = div class='feedback' id='feedbackElement' style='display:none;position:absolute;left: + offset.left + px;top: + (offset.top + 0) +px'p + feedbackMessage + /p/div; $(body).append(feedbackDiv); $('#feedbackElement').fadeIn('slow'); setTimeout($('#feedbackElement').fadeOut('slow', function(){$('#feedbackElement').remove();});,3000); } How do I change this to add an optional callback function to operate once the function has completed? Thanks, Dan. -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog -- -- Scott Trudeau scott.trudeau AT gmail DOT com http://sstrudeau.com/ AIM: sodthestreets -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog
[jQuery] Re: getting element number?
Yea, i just thought about the .each thing about 15mins ago and it worked perfect. Thanks for the replies. Bohdan Ganicky wrote: Hi Eridius, I guess this could do it: $('#' + self.options.auto_complete_id + ' li').each(function(i) { // i is now an index $(this).bind('mouseover', function() { //do something on mouseover }); }); -- Bohdan Ganicky On Feb 5, 2:15 pm, Eridius [EMAIL PROTECTED] wrote: $('#' + self.options.auto_complete_id + ' li').bind('mouseover', function() { //code }); now is there a way i can get the element number of the one my mouse is currently over? I mean lets say there is 10 li's in that list and my mouse is over the 4th one, is there a easy way to get the number 3(since javascript 0 is the first and so on)? -- View this message in context:http://www.nabble.com/getting-element-number--tp15289891s27240p152898... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/getting-element-number--tp15289891s27240p15292916.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Zebra striping in tables
Hi Snef, Since you asked me directly, I thought I should put in my answer, for the record. Here goes: What they said ... :-) (i.e. I agree with Allex and Rob) Cheers, --Karl On Feb 5, 2008, at 11:13 AM, Smith, Allex wrote: Rob definitely has the best answer here. Structure your table like so: table captionCaptions are good/caption thead tr thheader/th throw/th /tr /thead tfoot tr tdfooter/td tdrow/td /tr /tfoot tbody tr tdrow/td tdone/td /tr tr tdrow/td tdtwo/td /tr /tbody /table Then you don't have to worry about the checking for the first row and it will not be part of your structure. Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of RobG Sent: Tuesday, February 05, 2008 5:06 AM To: jQuery (English) Subject: [jQuery] Re: Zebra striping in tables On Feb 5, 7:57 pm, Snef [EMAIL PROTECTED] wrote: Karl, Again, many thanks. Only just one question... I have used your one-liner like this: $(table tr:nth-child(even)).css(background, #cc); I played around with the :not(:first) to eliminate the first row of each table but i do not get it working. Is this possible to use this, or is it better to just change all the firstrows after yoour one- liner? (at the end, i can use a special classname for the first row, but I'm curious to know if it can work without it!) Consider putting your header rows in a thead element, then use: $(tbody ... -- Rob
[jQuery] toggle + fade = possible?
toggle() works great but im wondering if its possible to combine it with fadeIn / fadeOut so that the change isnt so abrupt? i tried just appending it after toggle() in the code below but that doesnt work. anyone? $(.bio-toggler).click(function () { $(#bio-form).toggle() });
[jQuery] Re: Zebra striping in tables
Yes, I know! ;) Thanks! Smith, Allex schreef: Rob definitely has the best answer here. Structure your table like so: table captionCaptions are good/caption thead tr thheader/th throw/th /tr /thead tfoot tr tdfooter/td tdrow/td /tr /tfoot tbody tr tdrow/td tdone/td /tr tr tdrow/td tdtwo/td /tr /tbody /table Then you don't have to worry about the checking for the first row and it will not be part of your structure. Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of RobG Sent: Tuesday, February 05, 2008 5:06 AM To: jQuery (English) Subject: [jQuery] Re: Zebra striping in tables On Feb 5, 7:57�pm, Snef [EMAIL PROTECTED] wrote: Karl, Again, many thanks. Only just one question... I have used your one-liner like this: $(table tr:nth-child(even)).css(background, #cc); I played around with the :not(:first) to eliminate the first row of each table but i do not get it working. Is this possible to use this, or is it better to just change all the firstrows after yoour one- liner? (at the end, i can use a special classname for the first row, but I'm curious to know if it can work without it!) Consider putting your header rows in a thead element, then use: $(tbody ... -- Rob
[jQuery] Re: XML Processing
Thanks for the help Shawn! Works great! On Jan 21, 3:38 am, Shawn [EMAIL PROTECTED] wrote: I did it in this way // jquery version: 1.2.1 packed if($.browser.msie){// in ie6 $xml=xml+$response+/xml;// xml .. /xml is needed for ie6}else{ $xml=$xml.replace(]],).replace(![CDATA[,);// jquery maybe not not support this in firefox.. } // Then this code works fine. // and no Object does not support this property or method any more. alert($($xml).find('somekey').text());
[jQuery] Re: yet another beginner's diary (pls review!)
Hi Cherry - I enjoyed reading your blog. It's especially interesting informative to read what issues jQuery newcomers come across. One issue that it seemed you may not have grasped is when to escape characters. This isn't something specific to jQuery - it's actually a Javascript-wide issue, but you run across it a lot with jQuery. It's simple once you realize what's going on: You only need to escape characters within data when they are the same as the character you're using to surround (define) the data. Basically you are preventing Javascript from being confused about the start end of the data. Simplifying the replace text with an image example in your blog a bit: $('h1').append('..'); ...Here you are using single quotes to define the parameter data for append, so you only need to escape any single quotes that are within your parameter data. There are none, so it's not necessary to escape anything. For consistency's sake, in your example the double quote after fullinfo.html is missing a backslash. But, it doesn't matter since again for that example, you don't need to escape double quotes at all. You've inadvertently discovered this: it's a great idea to use single quotes to define the parameter data when using HTML code, since usually you don't need to escape anything (unless there are single quotes in your HTML). If you're defining a something like a sentence containing single quotes, it's best to use double quotes to define it since you don't have to escape the single quotes: $('h1').append(Here's a sentence that's got some single apostrophes.); ...again because I'm using double quotes to define the start/end of the sentence, only double quotes within the sentence will cause problems. There are none, so I'm all set. Taking one more look at your example, I've changed the title to contain some single quotes. Both of these examples will work, but I prefer the 2nd one since there's a lot less escaping to be done. $('h1').append(img src=\/images/headertext.gif\ alt=\alt text\ title=\Here's a great site. It's awesome.\ longdesc=\http:// something.com/fullinfo.html\ /); $('h1').append('img src=/images/headertext.gif alt=alt text title=Here\'s a great site. It\'s awesome. longdesc=http:// something.com/fullinfo.html /'); Hope that makes (more?) sense. -Wick CarComplaints.com On Feb 3, 11:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Seriously, I beg for your opinions/corrections/suggestions ... http://cherry.austin.googlepages.com/home Cherry
[jQuery] [validate] Validate non-required field
Hello, I want to validate a non-required text field that can hold an email address. That is, it can be empty, but if it does contain text it must be a valid email address. I use jQuery 1.2.2 and jQuery validation plug-in v1.2. This code allows any input for some reason: form id=form1 action=/home.ashx/sendmail method=post enctype=application/x-www-form-urlencoded div div label for=ContactRequest_EmailOptional email:/label input id=ContactRequest_Email dir=ltr title=Optional email name=ContactRequest_Email value= type=text / /div div button type=submit Send/button /div /div /formscript type=text/javascript$(function () { $ (#form1).validate({rules:{contactRequest_Email: {email:true}},messages:{contactRequest_Email:{email:The value must be a valid e-mail address.}}}); });/script What I'm doing wrong? Felix.
[jQuery] Re: Reverse Ajax in jQuery
FYI, for anyone else who might want a solution for this.. I ended up doing it using an alternate reverse ajax which closes the connection after an update is sent. On the first call, the client requests a long-executing call be started. The server starts a thread to perform the request and returns an ID to identify the request. The client then updates the page UI and immediately requests an update from the server. The server sits on the request (pauses the request thread) until new status information is available, at which point it sends the status back to the client (I use XML do to the infrastructure of my site, you could use JSON). The client then updates the UI again. This repeats until the state received from the server indicates the call is complete. - Jamie On Jan 25, 8:47 am, Jamie [EMAIL PROTECTED] wrote: Hey, Has anyone ever tried any reverse ajax solution using jQuery? I have a slow-loading ajax call and would like the server to send back status updates through the open HTML connection. Does anyone know how I could gain access to the server response data as in comes in, rather than at the completion of the ajax call? Thanks! Jamie Goodfellow
[jQuery] Re: link stops working in fragment returned from ajax depending on select
Anyone have any suggestions. I have tried liveQuery and I have tried it with the Forms plugin but I just can not get the first set of returned links to act as links after the second set of data has been returned. To see it in action http://ncas-cms.nerc.ac.uk/data/startFiles/anim_overlay.php click on one in the left select. One will be chosen for you in the right select. Now try the links in the table below - notice how only the link for the right select results works... I know its something about the DOM, but... Thanks in advance
[jQuery] Radio Buttons and Cloning
Hey, I'm trying to clone a section of code that contains radio buttons. I'd like the original section the cloned section to be in different radio button groups. However, this doesn't seem to be happening with jQuery cloning. I've reduced my code as much as possible to test out the scenario, the code is below. For note, I've tried both the method below (clone, change properties, add to page) as well as the reverse (clone, add to page, change properties). Anyone know how to get this to work? $(#testRadio1).val(bloop1); $(#testRadio2).val(bloop2); $([name='testRadio']).click(function(event) { alert($(this).attr('id') + [ + $(this).attr('name') + ]: + $ (this).val()); }); $(#testRadio1).clone(true).attr('id', 'testRadio3').attr('name', 'testRadioB').val(bloop3).insertBefore($(#formCreateService)); $(#testRadio2).clone(true).attr('id', 'testRadio4').attr('name', 'testRadioB').val(bloop4).insertBefore($(#formCreateService)); Thanks! Jamie Goodfellow
[jQuery] Re: jQuery Plugin to show Table Headers always?
Shall I explain better what I mean or does nobody know an answer? Thanks! On 2 Feb., 13:14, KnoxBaby [EMAIL PROTECTED] wrote: Hello, I have a very big table with many rows and columns. The first row and the first column contain some titles/descriptions. Is there a jquery plugin, that always shows the first column and the first row when I scroll to much to the right and/or bottom so that it they couldn't be seen anymore without the plugin??? Thanks!!
[jQuery] Re: scrollTo Firefox
stirman let me know I had a missing { in the code. Right after the first function. This is the corrected version in case someone uses it as a base for something else. jQuery(function( $ ){ var positions = [ '-=900', '+=900', 4000 ];//scroll positions var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url }); }); Ariel Flesler On 5 feb, 12:11, Ariel Flesler [EMAIL PROTECTED] wrote: I think the problem is that you are not preventing the # from appearing in the url, that generates some sort of default scroll, I'd bind those onclicks in a non-obstrusive way, try this: script type=text/javascript jQuery(function( $ ) $.scrollTo.defaults.axis = 'x';//so we don't need to specify each time. var $links = $('div.move_link a');//the 3 links $links.eq(0).click(function(){//left $.scrollTo( '-=900', 300 ); return false;//don't let that # appear on the url }); $links.eq(1).click(function(){//right $.scrollTo( '+=900', 300 ); return false; }); $links.eq(2).click(function(){//current $.scrollTo( 4000, 300 ); return false; });}); /script That's it. If you want a smaller, cooler way: script type=text/javascript jQuery(function( $ ) var positions = [ '-=900', '+=900', 4000 ];//the scroll positions of each link var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this ? 0, 1 or 2 ? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url });}); /script I hope it works well for you. Cheers Ariel Flesler On 5 feb, 03:18, stirman [EMAIL PROTECTED] wrote: Hey all, somewhat new to jQuery.. glad to have found this group, hope to be involved and help out when I can. Trying out the scrollTo plugin atwww.stirman.net... just some dummy data there now. Everything is working great in Safari, but in FF, the scrollTo links don't work at all? Is there something I am missing? (scrollTo:http://plugins.jquery.com/project/ScrollTo) Thanks! -Stirman- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: Email validation broken in plugin v1.2?!
Seth - TA schrieb: Jörn - Thanks for doing that. Is 1.2.1 out? I saw in the trunk that the validate.js says 1.2.1pre. Is it usable? Thanks. Yes, it is usable. Unless I get more bug reports I'll release that in one or two days. Let me know if you spot a problem, I should be able to fix it in a few hours. Jörn
[jQuery] ui.slider as horizontal scrollbar
Hi, I have made an attempt at making a horizontal scrollbar using the ui.slider and bits of code hacked together from the UI examples. So far so good in that it works on all browsers, and my code seems ok. There is a problem however in mostbrowsers (apart from Firefox, surprise surprise!), especially IE6 and IE7. The slider works, but the user feedback and rendering seem sluggish and slow at best. Here is an example of what I am talking about: http://www.fazalkhan.co.uk/garbage/jquery/scroll/scroll.html the JS is here: http://www.fazalkhan.co.uk/garbage/jquery/scroll/javascript/functions.js Apologies for the massive CSS stylesheet, this has been cut out from a project currently in production. any feedback will be greatly appreciated in getting this to work smoothly! Thanks in advance, Fazal
[jQuery] Re: [Validate] Two fields, one error message
Michael Price schrieb: Hi all, Hoping (and betting) that this is a simple fix but I have two fields - the month and year of a card expiry date. Both of them need to have a selection made, but I only want to show ONE error message if EITHER of them are left blank. At the moment, if both fields are left blank, two error messages appear underneath the boxes. Is there a way to tie both fields together so only one message is displayed? Currently the best approach is a custom method that checks both fields, but is added only to one of them. If you have two fields side-by-side its good for message display to add the rule to the right one. As that question now came up a few times I've added (http://dev.jquery.com/changeset/4648) an example to the dynamic-totals-demo: http://dev.jquery.com/view/trunk/plugins/validate/demo/dynamic-totals.html Its not perfect yet, focusing the invalid field needs to know which field is acutally invalid. Let me know if that works for you Jörn
[jQuery] Re: [validate] Validate non-required field
felixg schrieb: Hello, I want to validate a non-required text field that can hold an email address. That is, it can be empty, but if it does contain text it must be a valid email address. I use jQuery 1.2.2 and jQuery validation plug-in v1.2. This code allows any input for some reason: [...] What I'm doing wrong? Could you post a testpage? Your example code looks fine. Jörn
[jQuery] Re: UPDATER
Try this: http://www.ajtrichards.co.uk/heartbeat/ On Feb 4, 3:16 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any function like AJAX.UPDATER in Prototype ?? Or how can I automaticly do AJAX.req in time interval for.ex. 2 minutes ?
[jQuery] Re: scrollTo Firefox
Many thanks Ariel!!! On Feb 5, 12:55 pm, Ariel Flesler [EMAIL PROTECTED] wrote: stirman let me know I had a missing { in the code. Right after the first function. This is the corrected version in case someone uses it as a base for something else. jQuery(function( $ ){ var positions = [ '-=900', '+=900', 4000 ];//scroll positions var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url }); }); Ariel Flesler On 5 feb, 12:11, Ariel Flesler [EMAIL PROTECTED] wrote: I think the problem is that you are not preventing the # from appearing in the url, that generates some sort of default scroll, I'd bind those onclicks in a non-obstrusive way, try this: script type=text/javascript jQuery(function( $ ) $.scrollTo.defaults.axis = 'x';//so we don't need to specify each time. var $links = $('div.move_link a');//the 3 links $links.eq(0).click(function(){//left $.scrollTo( '-=900', 300 ); return false;//don't let that # appear on the url }); $links.eq(1).click(function(){//right $.scrollTo( '+=900', 300 ); return false; }); $links.eq(2).click(function(){//current $.scrollTo( 4000, 300 ); return false; });}); /script That's it. If you want a smaller, cooler way: script type=text/javascript jQuery(function( $ ) var positions = [ '-=900', '+=900', 4000 ];//the scroll positions of each link var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this ? 0, 1 or 2 ? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url });}); /script I hope it works well for you. Cheers Ariel Flesler On 5 feb, 03:18, stirman [EMAIL PROTECTED] wrote: Hey all, somewhat new to jQuery.. glad to have found this group, hope to be involved and help out when I can. Trying out the scrollTo plugin atwww.stirman.net... just some dummy data there now. Everything is working great in Safari, but in FF, the scrollTo links don't work at all? Is there something I am missing? (scrollTo:http://plugins.jquery.com/project/ScrollTo) Thanks! -Stirman- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: yet another beginner's diary (pls review!)
That is absolutely brilliant :)) A massive help - thank you, Wick! As you've seen, my Javascript is rubbish to begin with. Having to deal with jQuery structures, without much ground-level knowledge, is really hard at times. I almost chose Prototype, which looked as though I could apply more PHP-type thinking ... but went for jQuery because it has such a great community. In that, at least, I was definitely right! Cherry :) On Feb 5, 5:10 pm, wick [EMAIL PROTECTED] wrote: Hi Cherry - I enjoyed reading your blog. It's especially interesting informative to read what issues jQuery newcomers come across. One issue that it seemed you may not have grasped is when to escape characters. This isn't something specific to jQuery - it's actually a Javascript-wide issue, but you run across it a lot with jQuery. It's simple once you realize what's going on: You only need to escape characters within data when they are the same as the character you're using to surround (define) the data. Basically you are preventing Javascript from being confused about the start end of the data. Simplifying the replace text with an image example in your blog a bit: $('h1').append('..'); ...Here you are using single quotes to define the parameter data for append, so you only need to escape any single quotes that are within your parameter data. There are none, so it's not necessary to escape anything. For consistency's sake, in your example the double quote after fullinfo.html is missing a backslash. But, it doesn't matter since again for that example, you don't need to escape double quotes at all. You've inadvertently discovered this: it's a great idea to use single quotes to define the parameter data when using HTML code, since usually you don't need to escape anything (unless there are single quotes in your HTML). If you're defining a something like a sentence containing single quotes, it's best to use double quotes to define it since you don't have to escape the single quotes: $('h1').append(Here's a sentence that's got some single apostrophes.); ...again because I'm using double quotes to define the start/end of the sentence, only double quotes within the sentence will cause problems. There are none, so I'm all set. Taking one more look at your example, I've changed the title to contain some single quotes. Both of these examples will work, but I prefer the 2nd one since there's a lot less escaping to be done. $('h1').append(img src=\/images/headertext.gif\ alt=\alt text\ title=\Here's a great site. It's awesome.\ longdesc=\http:// something.com/fullinfo.html\ /); $('h1').append('img src=/images/headertext.gif alt=alt text title=Here\'s a great site. It\'s awesome. longdesc=http:// something.com/fullinfo.html /'); Hope that makes (more?) sense. -Wick CarComplaints.com On Feb 3, 11:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Seriously, I beg for your opinions/corrections/suggestions ... http://cherry.austin.googlepages.com/home Cherry
[jQuery] Re: Reverse Ajax in jQuery
You can check out the plugin I have been working on also. It uses the Bayeux protocol to handle channeled communication with a cometd server. http://plugins.jquery.com/project/Comet On Feb 5, 2008 8:11 AM, Jamie [EMAIL PROTECTED] wrote: FYI, for anyone else who might want a solution for this.. I ended up doing it using an alternate reverse ajax which closes the connection after an update is sent. On the first call, the client requests a long-executing call be started. The server starts a thread to perform the request and returns an ID to identify the request. The client then updates the page UI and immediately requests an update from the server. The server sits on the request (pauses the request thread) until new status information is available, at which point it sends the status back to the client (I use XML do to the infrastructure of my site, you could use JSON). The client then updates the UI again. This repeats until the state received from the server indicates the call is complete. - Jamie On Jan 25, 8:47 am, Jamie [EMAIL PROTECTED] wrote: Hey, Has anyone ever tried any reverse ajax solution using jQuery? I have a slow-loading ajax call and would like the server to send back status updates through the open HTML connection. Does anyone know how I could gain access to the server response data as in comes in, rather than at the completion of the ajax call? Thanks! Jamie Goodfellow -- http://morglog.alleycatracing.com Lets make up more accronyms! http://www.alleycatracing.com LTABOTIIOFR! ROFL! ROFL! ROFL! Upcoming alley cats, reviews, touring logs, and a general congregation of bike nerdity.
[jQuery] Access original element in ajax callback function
Is there any other way to do it than this? Could I somehow pass the original element to the callback function? $('.abc a').click(function() { var tmp = $(this); $.get('/abc', {id: '1'}, function(data) { tmp.next().html(data); }); return false; });
[jQuery] Re: [validate] use of [] for the name and id of the form input
lorent schrieb: Hello, I have to use [] in the name and the id of the inout of my form. For example, I use this syntax: input id=tx_dmmjobcontrol_pi1[apply][city] type=text class=textCity name=tx_dmmjobcontrol_pi1[apply][city] / And in the jqurey : tx_dmmjobcontrol_pi1[apply][city]: { required: true, }, On firefox, the validation is ok. But the script doesnt work on IE. I have an error cause of the utilisation of ... but if i dont use the , the [] are causing problems and i have to use them. Is there a solution to use name and id with [ ] and to make work the script on Internet Explorer ? Thanks you for your help ! You've got a simple syntax error that Firefox like to ignore, which isn't exactly helpful. Try this, note that there isn't a trailing comma after required:true: tx_dmmjobcontrol_pi1[apply][city]: { required: true }, Jörn
[jQuery] :contains and case sensitive results
Hi there, hopefully a quick question: I'm setting up a filter box that, on key up, will show/hide rows in a table based on a certain columns text() value. What I'd like to do is the following: $('tablename' tr td:contains('filtertext').parent().show(); as an example. However my understanding is that the :contains filter is case sensitive. If I have the following table: table trtdJoe/td/tr trtdTedd/td/tr /table and the user is trying to filter by a lower case j nothing would match. Is there a workaround to making the :contains filter case insensitive? Thank you.
[jQuery] prevAll() Working in Safari 3 but not Firefox (2 or 3pre Beta)
Hello everyone! I've been reading this group's messages for a while now. Its really helpful and has kept me from having to ask a question. Until now. i'm having an issue with some code working in Safari 3 but not in Firefox 2.0.0.11 and Firefox 3pre Beta (the nightly builds). I have a file called jsfile.js where i have a good bit of my jQuery code and another file called htmlfile.html. The jQuery and jsfile files are linked in the header of htmlfile.html. The problem i am having is that in Safari 3, the Hide These link in p class=More does hide the Stuff div in Safari 3. However in Firefoxes 2 and 3pre it does not. Following is my HTML: td class=StreamBody a class=hidden_toggle href=# target=_blank onclick=showHiddenActivitiesLists(this); return false;the link to display the Stuff div below/abr / div class=Meta div class=timea href=some_link class=secondaryanother link/a /div /div div class=Stuff style=display:none ul class=Music li class=hidden_activitya list item/li /ul p class=Morea href=# class=secondary onclick=$ (this).parent().parent().prevAll('a.hidden_toggle').click(); return false;Hide These/a/p /div /td And now for my javascript: function showHiddenActivitiesLists(el) { $(el).attr('onclick','hideHiddenActivitiesLists(this); return false;'); $(el).parents('.StreamBody').children('.StreamStuff').fadeIn(500); } function hideHiddenActivitiesLists(el) { $(el).attr('onclick','showHiddenActivitiesLists(this); return false;'); $(el).parents('.StreamBody').children('.StreamStuff').fadeOut(500); } The Hide These onclick should traverse the DOM to the hidden_toggle and then call the .click() on that link. It does this in Safari 3, thus re-hiding the Stuff div. However it seems Firefox 2 and 3pre ignore it. Any ideas why it would work in Safari 3 and not Firefox?
[jQuery] [validate] error in jquery.validate.pack.js ie6
im getting one error using the jquery.validate.pack.js in ie6 not happening with normal version
[jQuery] A working copy of jQuery UI?
So I downloaded jQuery 1.2.2 and UI from the site, and kept getting errors (such as draggables throwing a not a function error.) I borrowed a copy of ui from some random website, which at least got draggables to work, but not entirely - opacity isn't working. It seems like I can't depend on ui.jquery.com to get a functioning copy of jquery ui - the dialog that downloads a minified copy of different plugins isn't even working. Can someone direct me to a (preferably) minified copy of jquery ui that works with 1.2.2?
[jQuery] Fire history/remote from actual DIV
Hi all, I'm using Klaus' History/Remote plugin for Jquery. I have the JS included, and the script looks like this: script type=text/javascript $(function() { $('a.remote').remote('#files', function() { if (window.console window.console.info) { console.info('content loaded'); } }); $.ajaxHistory.initialize(); }); /script So the new content is displayed in the div id=files/div which works quite alright, but once i've fired new content into that div, and that content has new links with the class=remote attribute, they don't work anymore. I reckon that has something to do with the links not being indexedalready, but my knowledge in JS is very little, so please bear with me How could I solve this? Thanks, Frizzle.
[jQuery] Re: Email validation broken in plugin v1.2?!
Hey Jörn - Thank you for fixing this is the next release. I have just submitted a bug report. Please see message: [validate] validator.pendingRequest below 0 (function stopRequest is called when not needed resulting in pendingRequest becoming less than 0) - also submitted a solution. Yuval Karmi On Feb 5, 2:06 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Seth - TA schrieb: Jörn - Thanks for doing that. Is 1.2.1 out? I saw in the trunk that the validate.js says 1.2.1pre. Is it usable? Thanks. Yes, it is usable. Unless I get more bug reports I'll release that in one or two days. Let me know if you spot a problem, I should be able to fix it in a few hours. Jörn
[jQuery] [validate] validator.pendingRequest below 0
Hey Jorn, I believe I have found a bug in jquery.validate 1.2. I use a few remotes to make sure a username or an email is not taken. Sometimes I would have some errors in my form and would click the submit button a few times to validate fields - and then would fix the fields containing errors, and then try to submit the form, but it would simply not submit. So after a lot of trial and error I decided to add the following line: alert(validator.pendingRequest); in this block of jquery.Validate code: if ( validator.pendingRequest ) { alert(validator.pendingRequest); //The line I added validator.formSubmitted = true; return false; } In one instance I got -3 as a result - meaning that requests inexistent request were cancelled, lowering validator.pendingRequest below zero. Solution: Replace the existing stopRequest function stopRequest: function(element, valid) { this.pendingRequest--; delete this.pending[element.name]; if ( valid this.pendingRequest == 0 this.formSubmitted this.form() ) { jQuery(this.currentForm).submit(); } }, With this one stopRequest: function(element, valid) { if(this.pendingRequest0){ //NOTICE THIS this.pendingRequest--; } //NOTICE THIS delete this.pending[element.name]; if ( valid this.pendingRequest == 0 this.formSubmitted this.form() ) { jQuery(this.currentForm).submit(); } }, so pendingRequest is only lowered if it is greater than 0 - resulting in the form actually being submitted when all fields are correct. Hope I could help and things would be fixed in the next release. Thanks, Yuval Karmi
[jQuery] Re: getting the ID number of a cloned table row
Bruce MacKay wrote: : Hello folks, : : I'm trying to duplicate a row of an existing table using a function : adapted from : http://www.nabble.com/Add-Table-row-to12989886s27240.html#a13300133 : : My problem is that I cannot identify the identifier of the last row : (of the original table). From the html you provided, this gets the last ID. // The match should return an array with the current id in the 0 // position. The + sign in front converts this ID to a number. var currentID = + $(clonedRow).find('input').attr('id').match( /\d+/ )[0]; var newID = currentID + 1; The problem is that clone() does not work right in Internet Exploder. There's a patch due, but no advance yet. So, the solution works on FF, but not on IE. (http://www.fusioncube.net/?p=196) In fact, the method above needs filter() to work on IE. // Solution for IE. var currentID = + $(clonedRow).filter('input').attr('id').match( /\d+/ )[0]; var newID = currentID + 1; : function duplicateRow(){ [snip] Manipulating the html directly probably isn't the most jQuery-ish way to handle this. $(clonedRow).find( '#bc' + currentID ).eq(0).attr({ id: 'bc' + newID, name: 'correctans' + newID }); $(clonedRow).find( '#theans' + currentID ).eq(0).attr({ id: 'theans' + newID, name: 'answer' + newID }); $(clonedRow).find( '#fb' + currentID ).eq(0).attr({ id: 'fb' + newID, name: 'feedback' + newID }); // Add to the new row to the original table $( #myTable).append( clonedRow ); So, for now, you may need another solution besides clone(). HTH, Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate Web Programmer 254 968-8328 http://www.clarksonenergyhomes.com/wordpress/about/
[jQuery] wierd thickbox reloaded behavior
I am getting some weird behavior from thickbox reloaded. for some reason when i trigger a thickbox, it reloads the page with the thickbox by default showing. I am going to debug this but does anyone know what might cause this? it might might be my code plug-ins are overwriting a event on something so any information to send me in the right direction would be great. -- View this message in context: http://www.nabble.com/wierd-thickbox-reloaded-behavior-tp15299911s27240p15299911.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: [validate] error in jquery.validate.pack.js ie6
Sebastián Würtz schrieb: im getting one error using the jquery.validate.pack.js in ie6 not happening with normal version Could you give the latest revision a try? http://dev.jquery.com/view/trunk/plugins/validate/ Jörn
[jQuery] Re: [validate] validator.pendingRequest below 0
Yuval schrieb: Hey Jorn, I believe I have found a bug in jquery.validate 1.2. I use a few remotes to make sure a username or an email is not taken. Sometimes I would have some errors in my form and would click the submit button a few times to validate fields - and then would fix the fields containing errors, and then try to submit the form, but it would simply not submit. So after a lot of trial and error I decided to add the following line:[...] Hope I could help and things would be fixed in the next release. That can also be fixed by including the ajaxQueue plugin, which will be bundled with the validation plugin in the future. Please give the latest revision a try: http://dev.jquery.com/view/trunk/plugins/validate/ That will be released as 1.2.1 very soon. Let me know if it fixes the issue. Jörn
[jQuery] Re: [validate] error in jquery.validate.pack.js ie6
Jörn Zaefferer escribió: Sebastián Würtz schrieb: im getting one error using the jquery.validate.pack.js in ie6 not happening with normal version Could you give the latest revision a try? http://dev.jquery.com/view/trunk/plugins/validate/ Jörn when i detect the first error i download the last version, and now the error is missing ')' im using the normal version now, i mean the unconpressed one and 1.2
[jQuery] Re: [validate] error in jquery.validate.pack.js ie6
Sebastián Würtz schrieb: Jörn Zaefferer escribió: Sebastián Würtz schrieb: im getting one error using the jquery.validate.pack.js in ie6 not happening with normal version Could you give the latest revision a try? http://dev.jquery.com/view/trunk/plugins/validate/ Jörn when i detect the first error i download the last version, and now the error is missing ')' im using the normal version now, i mean the unconpressed one and 1.2 Unless you provide a testpage I can't help you. There is no missing ')' in the repository files. Jörn
[jQuery] Re: Most basic of basic fundamental questions.
This is a critical point to get to use Javascript effectively. The line $('.poem-stanza').addClass('emphasized'); by itself is executed as soon as the interpreter gets to it. function(){ $('.poem-stanza').addClass('emphasized'); } doesn't execute the addClass; it just creates a function that can be executed later It's just like writing, somewhere else in your code: function someFunction() { $('.poem- stanza').addClass('emphasized'); } except that the first function doesn't have a name (it's anonymous). It still can be assigned to a variable or passed as an argument. So: $(document).ready(function() { $('.poem-stanza').addClass('emphasized'); }); creates an anonymous function and passes it to the $(document).ready function, and $(document).ready keeps the reference to that function around until the document is in fact ready, then executes it. But: $(document).ready( $('.poem-stanza').addClass('emphasized'); ); does the $('.poem-stanza').addClass('emphasized'); immediately: it finds all elements with class 'poem-stanza' which probably is nothing since your script element is probably in the head, before any of the body elements have been created, adds the class to whatever it found and passes those elements (not a function!) to $(document).ready. $(document).ready expects to get a function, not a jQuery object of HTML elements, and will probably throw an error. I think Javascript 2 will have a more elegant way of expressing a block of code to be stored and executed later but for now we have to use function(){...} HTH, Danny On Feb 5, 9:30 am, Pickledegg [EMAIL PROTECTED] wrote: I'm reading 'learning jQuery'. In this example, and in fact every example, why do you pass a function as an argument. $(document).ready(function() { $('.poem-stanza').addClass('emphasized'); }); why can't I do this? $(document).ready( $('.poem-stanza').addClass('emphasized'); ); Thanks. I'm asking this a learning exercise, so I apologize in advance for the apparent stupidity of it.
[jQuery] Re: [validate] error in jquery.validate.pack.js ie6
Jörn Zaefferer escribió: Sebastián Würtz schrieb: Jörn Zaefferer escribió: Sebastián Würtz schrieb: im getting one error using the jquery.validate.pack.js in ie6 not happening with normal version Could you give the latest revision a try? http://dev.jquery.com/view/trunk/plugins/validate/ Jörn when i detect the first error i download the last version, and now the error is missing ')' im using the normal version now, i mean the unconpressed one and 1.2 Unless you provide a testpage I can't help you. There is no missing ')' in the repository files. Jörn anyways thx in advance for your help, i cant upload all the whole site for now, but i contact u later o ill try to check better this.
[jQuery] Re: getting the ID number of a cloned table row
Thanks Charles for this full and complete response - I very much appreciate it. Cheers Bruce At 09:27 a.m. 6/02/2008, you wrote: Bruce MacKay wrote: : Hello folks, : : I'm trying to duplicate a row of an existing table using a function : adapted from : http://www.nabble.com/Add-Table-row-to12989886s27240.html#a13300133 : : My problem is that I cannot identify the identifier of the last row : (of the original table). From the html you provided, this gets the last ID. // The match should return an array with the current id in the 0 // position. The + sign in front converts this ID to a number. var currentID = + $(clonedRow).find('input').attr('id').match( /\d+/ )[0]; var newID = currentID + 1; The problem is that clone() does not work right in Internet Exploder. There's a patch due, but no advance yet. So, the solution works on FF, but not on IE. (http://www.fusioncube.net/?p=196) In fact, the method above needs filter() to work on IE. // Solution for IE. var currentID = + $(clonedRow).filter('input').attr('id').match( /\d+/ )[0]; var newID = currentID + 1; : function duplicateRow(){ [snip] Manipulating the html directly probably isn't the most jQuery-ish way to handle this. $(clonedRow).find( '#bc' + currentID ).eq(0).attr({ id: 'bc' + newID, name: 'correctans' + newID }); $(clonedRow).find( '#theans' + currentID ).eq(0).attr({ id: 'theans' + newID, name: 'answer' + newID }); $(clonedRow).find( '#fb' + currentID ).eq(0).attr({ id: 'fb' + newID, name: 'feedback' + newID }); // Add to the new row to the original table $( #myTable).append( clonedRow ); So, for now, you may need another solution besides clone(). HTH, Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate Web Programmer 254 968-8328 http://www.clarksonenergyhomes.com/wordpress/about/
[jQuery] clone and replacing one string for another
Hello folks, I am using the .clone() method to duplicate a fieldset containing some form elements e.g. var clonedRow = $( #sshow_input fieldset:last ).clone(); Within that cloned fieldset is a string of the form sListImage(x) where x = 1, 2, or 3 etc With each duplication I need to increment x by 1. I had hoped (rather than knowing) that myString = sListImage(3) myString2 = sListImage(4) var clonedRow2 = clonedRow.replace(myString,myString2); would do the trick. But once again, my guesses are falling well short. I'm being told that clonedRow.replace is not a function. I'd appreciate some help here. Thanks, Bruce
[jQuery] Re: scrollTo Firefox
I'll create a new plugin, similar to localScroll, that will do just that. Scroll between items, with prev/next like buttons, I suppose I'll have it soon (today or tomorrow) Cheers Ariel Flesler On 5 feb, 16:58, stirman [EMAIL PROTECTED] wrote: Many thanks Ariel!!! On Feb 5, 12:55 pm, Ariel Flesler [EMAIL PROTECTED] wrote: stirman let me know I had a missing { in the code. Right after the first function. This is the corrected version in case someone uses it as a base for something else. jQuery(function( $ ){ var positions = [ '-=900', '+=900', 4000 ];//scroll positions var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url }); }); Ariel Flesler On 5 feb, 12:11, Ariel Flesler [EMAIL PROTECTED] wrote: I think the problem is that you are not preventing the # from appearing in the url, that generates some sort of default scroll, I'd bind those onclicks in a non-obstrusive way, try this: script type=text/javascript jQuery(function( $ ) $.scrollTo.defaults.axis = 'x';//so we don't need to specify each time. var $links = $('div.move_link a');//the 3 links $links.eq(0).click(function(){//left $.scrollTo( '-=900', 300 ); return false;//don't let that # appear on the url }); $links.eq(1).click(function(){//right $.scrollTo( '+=900', 300 ); return false; }); $links.eq(2).click(function(){//current $.scrollTo( 4000, 300 ); return false; });}); /script That's it. If you want a smaller, cooler way: script type=text/javascript jQuery(function( $ ) var positions = [ '-=900', '+=900', 4000 ];//the scroll positions of each link var $links = $('div.move_link a').click(function(){ var index = $links.index(this);//which link is this ? 0, 1 or 2 ? $.scrollTo( positions[index], 300, {axis:'x'}); return false;//don't let that # appear on the url });}); /script I hope it works well for you. Cheers Ariel Flesler On 5 feb, 03:18, stirman [EMAIL PROTECTED] wrote: Hey all, somewhat new to jQuery.. glad to have found this group, hope to be involved and help out when I can. Trying out the scrollTo plugin atwww.stirman.net... just some dummy data there now. Everything is working great in Safari, but in FF, the scrollTo links don't work at all? Is there something I am missing? (scrollTo:http://plugins.jquery.com/project/ScrollTo) Thanks! -Stirman- Ocultar texto de la cita - - Mostrar texto de la cita -- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: preloading images with jquery in IE
Hi, maybe this can help you ? http://flesler.blogspot.com/2008/01/jquerypreload.html Cheers Ariel Flesler On 15 dic 2007, 16:18, ekallevig [EMAIL PROTECTED] wrote: Sorry, looks like some of my sample code didn't quite come through. So basically I started just trying to create an image and not actually insert it into the page, but just create it so the image would be downloaded to cache. So I tried this originally: $(' ').attr('src','/images/blah.jpg'); That didn't work in IE so I just assigned the new image element to a variable and it worked like this: var somevariable = $(' ').attr('src','/images/blah.jpg'); But you could also assign it to an array item as well like I mentioned earlier: array[item] = $(' ').attr('src','/images/blah.jpg'); Feed-2 wrote: I didn't quite understand your solution, ekallevig. Can you explain it again, please? I also tried Jannik's solution but it didn't work... it gives me an error saying that $img has no properties. On Dec 14, 1:41 pm, ekallevig wrote: I figured it out last night after I posted this. I just needed to assign the new element to a variable of some sort (or in my case an array item). I already had created an array to keep track of whether or not each image had already been preloaded (to avoid duplication), so instead of setting those array values to true/false, I just assigned the new image to them and it worked like a charm in all browsers. myimagearray[theimageindex] = $(' ').attr('src',buildThePathHere); or you could do it without jquery: myimagearray[theimageindex] = new Image(); myimagearray[theimageindex].src = buildThePathHere; -- View this message in context:http://www.nabble.com/preloading-images-with-jquery-in-IE-tp14330317s... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/preloading-images-with-jquery-in-IE-tp14330317s... Sent from the jQuery General Discussion mailing list archive at Nabble.com.- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: Post-load images? Tips?
Hi, have you tried this ? http://flesler.blogspot.com/2008/01/jquerypreload.html You preload the images, and with the callback onComplete, you swap the background, or with onFinish you swap them all together. Cheers Ariel Flesler On 22 ene, 06:26, Micky Hulse [EMAIL PROTECTED] wrote: Mika, that worked very well! Thanks for the help... It has definitely gotten me started in the right direction. I owe you one. :) Have a great night/day, and many many thanks for taking the time to help a noob! :D Cheers, M On Jan 21, 4:37 am, Mika Tuupola [EMAIL PROTECTED] wrote: On Jan 21, 2008, at 10:02 AM, Micky Hulse wrote: A bit more info: The hardest part for me to figure-out is the best approach for knowing when all of the needed images are loaded... I think I can handle all the other aspects of the coding. Is there a good technique for knowing when a group of images has fully loaded? One way would be topreloadimages sequentially one by one. When the last one is loaded then you could be sure all images are fully loaded. Something like: -cut- $(window).bind('load', function() { varpreload= new Array('image_1.png', 'image_2.png', 'image_3.png'); var img = document.createElement('img'); $(img).bind('load', function() { if(preload[0]) { this.src =preload.shift(); } else { /* all images have been loaded */ } }).trigger('load');}); -cut- -- Mika Tuupolahttp://www.appelsiini.net/- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: IE, change event, and bubbling
Found the answer to my own problem! This will help save anyone a headache if they ever come across the same problem: http://www.johnvey.com/blog/2007/07/ie-does-not-bubble-form-select-element-onchange-events On Feb 1, 9:09 am, ita [EMAIL PROTECTED] wrote: I'm usingeventbubbling to bind elements added dynamically. However, when I do something like this: $('body').change(function(event) { alert(changeevent!); }); it will only fire the alert box on FF but not in IE. However, if I use a clickeventlike this: $('body').click(function(event) { alert(clickevent!); }); this works in IE! Why does thechangeeventnot register in IE?
[jQuery] Re: - Problem with nested tabs
Interesting: The main tabs use the naming scheme from the demo (too lazy to change it, I guess), i.e.: tab-1, tab-2, etc. I created the nested tabs using the naming scheme of r1, r2, etc. Using this scheme was where the problem I outlined above occurred. When I changed the nested tab naming scheme to r_one, r_two, etc. the problem magically went away.
[jQuery] JS error on minify validate.js
Hi!, I was trying to minify the validate.js library and started to appear an js error on Internet Explorer. I decided to use the validate.min.js even when this have 10K more. There is no problem at all but I wanna to reported as a bug. :) Thanx a lot!!! By the way I love this library!
[jQuery] Re: copy li values to an array
Jonathan and Karl : thanks for your replies. Jonathan : I probably gave the impression that I wanted each 3rd li value copied to each array element. Your code worked brilliantly for that and I've stored it away for another day. Karl: that's exactly what I wanted. Problem solved. (BTW I use your 'Reference Guide' all the time) On 5 Feb, 01:00, Karl Swedberg [EMAIL PROTECTED] wrote: Oops. I forgot to take out the ul:first part of the selector. I had put that in there when I was testing on a random page in Firebug, so you can safely take it out. Also, if your LIs just have text in them, you can use $(this).text() instead of $(this).html() --Karl On Feb 4, 2008, at 7:10 PM, Karl Swedberg wrote: Hi Paul, I may have misunderstood what you were going for, but here is a different approach, just in case you were looking for an array like ['abc', 'def', 'ghi']: var txt = '', array1 = []; $('ul:first li').each(function(i){ txt = txt + $(this).html(); if (i % 3 == 2) { array1.push(txt); txt = ''; } }); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 4, 2008, at 5:00 PM, Jonathan Sharp wrote: Hi Paul, This should do the trick: $('li').each(function(i){ array1[ Math.floor( i / 3 ) ] = $(this).html(); }); Cheers, -Jonathan On 2/4/08, Paul Jones [EMAIL PROTECTED] wrote: I know the following would work if I wanted to copy the values of *each* li to a separate array element. html head title/title script type = text/javascript src=jquery.js/script script type = text/javascript var array1 = new Array() ; $(document).ready(function() { $('li').each(function(i) { array1[i] = this.innerHTML ) }) }) /script /head body ul lia/li lib/li lic/li lid/li lie/li lif/li lig/li lih/li lii/li /ul /body /html However, I would like like to copy the *concatenated* values of each group of 3 li's to 1 array element. (eg) the 1st array element would have a value of 'abc', the 2nd array element would have a value of 'def', and the 3rd array element would have a value of 'ghi' etc. What is the best way to do this? TIA
[jQuery] testrunner.js
I am trying to unittest a library I am writing so I grabbed testrunner.js and setup a test area in my project. I use $j = jQuery.noConflict(); throughout my library. How should I use the testrunner with this in mind? I can only get the testrunner to assert that my library's main object exists, as soon as I call any functions that reference jQuery with $j, I get the dreaded: --- console output --- $ is not a function [Break on this error] $(#main).html( _config.fixture ); --- I have tried to add the $j = jQuery.noConflict(); to the library itself, in the test.html head like so: jQuery(document).ready(function(){ var $j = jQuery.noConflict(); }); and in each test: test(test toc stuff, function() { var $j = jQuery.noConflict(); expect(1); document.doc_id = 1; ok($j, 'Test noConflict'); }); All of these attempts fail... any ideas? Do you guys do unittesting with non-jQuery/jQuery plugin code? Thanks, David
[jQuery] Re: - Problem with nested tabs
Argh... I spoke too soon
[jQuery] Re: toggle + fade = possible?
Hi Stef, You can write a custom animation like this: jQuery.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback); }; Then, you can do this: $(.bio-toggler).click(function () { $(#bio-form).fadeToggle() }); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 5, 2008, at 1:34 PM, stef wrote: toggle() works great but im wondering if its possible to combine it with fadeIn / fadeOut so that the change isnt so abrupt? i tried just appending it after toggle() in the code below but that doesnt work. anyone? $(.bio-toggler).click(function () { $(#bio-form).toggle() });