Looping jQuery function/animation [SOLVED]
Hello, New to jQuery and ran into what feels like it should be an easy to solve issue but I'm lost and can't seem to find an answer anywhere. I have the folowing function: function scroll_text(interval, element) { var element_width = $(element).outerWidth({ margin: true }); $(element).css("right", -element_width ); $(element).animate({right: element_width}, interval, 'linear'); } I want to make this function repeat over and over again indefinitely but of course the next occurrence
[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
[jQuery] yet another beginner's diary (pls review!)
Seriously, I beg for your opinions/corrections/suggestions ... http://cherry.austin.googlepages.com/home Cherry
[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] 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] [validate] Validation Plugin - how to remove a control form validation
Hi there I'm building a login form, with a "Forgot password" link. When clicked, I need to unset some validation options to successfully submit the form. The code I'm running does this: 1 - remove the validation constraints from the password field 2 - hide any error messages that were displayed for the password field 3 - submit the form using form.submit() However, I can't seem to do either properly. Here's the code I'm using: $('#password').attr('validation', '') $('label.error[for="password"]').hide()
[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] [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_Email">Optional email:</label> <input id="ContactRequest_Email" dir="ltr" title="Optional
[jQuery] Load syntax & Thickbox
Dear all JQuery User.. :D Can you all help me, I wan to use thickbox plugin with load syntax.. but thick box wont start when I call content_form.php , oh ya here is mycode : /*----------------------------------------------------- INDEX.PHP------------------------------------------------------------------- */ <script type="text/javascript" src="st_js/xp.js" language="javascript"></script> <script type="text/javascript" src="../st_js/jquery.js" language="javascript"></script> <script type="text/javascript"
[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> <tr><td>Joe</td></tr> <tr><td>Tedd</td></tr> </table> and the user is trying to filter by a lower case j nothing would match.
[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
[jQuery] Problems appending inputs with quotes in the value
I am trying to append an input box with quotes in the value, and no matter how many escapes I put on the quote (thinking maybe the escapes needed to be escaped), it fails to insert properly, like jQuery just ignores all escapes and goes straight for the quote. i.e.- If I try something like the following: $('form').append('<input type="text" name="foo" value="Quote - \"This is a quote\"" />'); The element that gets appended to the form has the following html: <input type="text" name="foo" value="Quote
[jQuery] Post-load images? Tips?
Hi, I am trying to load a group of images at the $(window).load(...) event, and then once the group is fully loaded, I want to swap the CSS background of specific divs with said loaded images. I am wondering what you all would suggest for an approach? Any pseudo- code suggestions? I am just basically needing a slight push in the right direction... This is for a personal project, and I am doing it mainly for jQuery learning purposes. ;) Many thanks in advance! Cheers, M
[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] preloading images with jquery in IE
I'm having some issues preloading images with jquery in IE. I tried just creating the image in memory with the appropriate source like this: $(' ').attr('src',iBuildThePathHere); But only Firefox will preload the image that way. The only way I've been able to successfully achieve the preloading in IE is to create the image element like above, then insert it in my document and then hide it instantly like this: $(' ').attr('src',iBuildThePathHere).insertAfter($('#someElement')).hide(); All the tutorials
[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] 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
[jQuery] IE, change event, and bubbling
I'm using event bubbling to bind elements added dynamically. However, when I do something like this: $('body').change(function(event) { alert("change event!"); }); it will only fire the alert box on FF but not in IE. However, if I use a click event like this: $('body').click(function(event) { alert("click event!"); }); this works in IE! Why does the change event not register in IE?
[jQuery] copy <li> values to an array
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> <li>a</li> <li>b</li> <li>c</li> <li>d</li> <li>e</li> <li>f</li> <li>g</li> <li>h</li> <li>i</li> </ul> </body> </html>
[jQuery] getting the ID number of a cloned table row
<html> <body> Hello folks, I'm trying to duplicate a row of an existing table using a function adapted from <a href="http://www.nabble.com/Add-Table-row-to12989886s27240.html#a13300133" eudora="autourl"> http://www.nabble.com/Add-Table-row-to12989886s27240.html#a13300133</a> My problem is that I cannot identify the identifier of the last row (of the original table). The last row of my table has the form: <pre><tr class="smfont90"><td><input name="correctans5" value="1" id="bc5" type="checkbox"></td><td><textarea
[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] [validate] Email validation broken in plugin v1.2?!
This email yuval@email validates perfectly on v1.2. No .com nothing... Is it broken or is it done on purpose? I tried it on my site AND on the remember-the-milk demo...
[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] [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.
[jQuery] UPDATER
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] 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
[jQuery] Reverse Ajax in jQuery
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] link stops working in fragment returned from ajax depending on select
I have two dropdown boxes, which, when clicked, return via ajax some information in a div. Inside that information is are multiple links. When I click on the left select- the links in the div below work fine. If I refresh and click on the right select- the links in the div below work fine. So each individual select box works as I would expect it. But... if I refresh and click on the left select, then click on the right select - the link for that right select work fine but the links from the left
[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'> " + feedbackMessage + "</div>"; $("body").append(feedbackDiv); $('#feedbackElement').fadeIn('slow'); setTimeout("$('#feedbackElement').fadeOut('slow',
[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");
[jQuery] XML Processing
Hey, I am attempting to process an XML document using jQuery but am hitting a brick wall. I've looked all over the web and it looks like this should be a very simple thing to do but I keep getting the error "Object does not support this property or method.". I'm using jQuery 1.2.1 in IE6. I've switched to the unpacked version of jQuery and IE is reporting the error is happening on line 1363, which turns out to be the following line: r = jQuery.merge( r, ret[i].getElementsByTagName( tag )); I've simplified
[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] 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
[jQuery] Problems with $(document).height() and jQuery 1.2.2
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
jcarousel help
Hello, I have a carousel question that I was wondering if I could get some assistance on. I basically have an image gallery, the thumbnails are aligned horizontally and the image they click on shows up above. This works fine, but what my friend would like is the ability for when they click on the left or right arrows to scroll through the thumbnails, whichever image is in the middle, the large version of it should appear at the top. Any help would be greatly appreciated. The example can be viewed
[jQuery] dynamic classes
I'm trying to trigger a form to show below a given comment in a list of comments but because I'm using a collection, the classes need to be dynamic. I'm not sure how to target a given comment. Right now, when I click on any of the buttons, the forms show for all the comments. Hope that makes sense. Any thoughts? Thanks.
[jQuery] AJAX file management
Hi, Can anyone recommend anything that allows you to manage files stored on the web in a tree-like GUI, allowing for drag-and-drop. I'm thinking of a web-based equivalent of what you may do with files on your desktop. Thanks, - Dave
[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", "#cccccc") 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
[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({
Internet Explorer problem (XML) [Solved]
Hello. I've got a problem with Internet Explorer. If I try to read the content of a XML tag, I receive no result like this: //'xml' is a variable with data received from an AJAX request alert($("message",xml).text()); //This doesn't work. The message box is empty alert(xml); //And here I get the correct result in my message box Does anyone recognises this problem? please help me. If you need the full script, please tell me. It works fine in Opera. I didn't test it in Firefox, but it's a problem with
Next Page