[jQuery] Suggestion code: Toggle not only to click
Hello. Some times we need to make toggle not only to click events. So I change the jQuery Code at line 2993-2954 to: toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, i = 1; //I added This 2 lines:********************************* var event='click'; if (!$.isFunction(fn)) {event=fn;fn=args [1];args=Array.prototype.slice.call( args,1 ) } // link all the functions, so any of them can unbind this click
[jQuery] How can I rebind this event after a ajax callback?
Hi everyone! I'm trying to create a text edit in place myself just by manipulating jQuery selectors. But, after the first ajax callback, the others callback for the same input text doesn't work anymore... I've tried to use livequery plugin but it didn't work... function editaVal(celDiv, id) { var novoConteudo = $("<input type='text' id='novoCont" + id + "' value='" + $(celDiv).html() + "' />"); $(celDiv).dblclick(function() { $(this).html(novoConteudo); }); $(novoConteudo).blur(function() { $(novoConteudo).parents("tr").removeClass('trSelected');
[jQuery] Apply class to range of child elements
I have a list of links, around 40 of them. I want to apply classes to groups of them. So, items 1-10 I want to apply a class to, then 11-20, then 21-30 and 31-40, each of these groups should have their own class. Is something like this possible? I looked through the jQuery selectors and could not find a solution.
$('#tab1 tr:gt(0)>td').filter(':nth-child(6n+1)') arrgghh
Hi guys - this drives me crazy I want to select td 7, 13, 19 and td 10 16 22 of each row of a table, except the 1st row: $('#tab1 tr:gt(0)>td').filter(':nth-child(6n+1),:nth-child(6n+4)') The problem I have is, that - beside the desired cols - the 1st td of each tr is selected as well This would be working: $('#tab1 tr:gt(0)').find('td:gt(1):nth-child(6n+1),td:gt(4):nth-child(6n+4)') But I think its a bit strange that you have to use td:gt(Y) where Y is the Y in :nth-child(Xn+Y). any better way?
[jQuery] To find number of rows and width of text area
Hi, In cilent side i had a text area. In server side i have to find number of rows (entered in that cilent text area) and highest length of the row to auto adjust the textarea. Thanks anjith
[jQuery] Suggestion: .unbind('.eventname")
Suggestion: .unbind('.event-title") $('div').bind('click.mybind',func1).bind('focus.mybind',func2).bind ('click",func3) Now I am trying to unbind func1& func2 like: $('div').unbind('click.mybind').unbind('focus.mybind'); My suggestion is that jQuery will support this: $('div').unbind('.mybind') What do you think?
[jQuery] Best Practices, Am I Using Them?
Greetings, I'm writing an accordion effect of some sorts into a new web site I am developing which utilizes load() to bring in the outside information into the div that's dropping down when I click a particular link. I've had to use livequery as well since there is javascript (using the UI Tabs Plug-in) inside the div that's getting populated by load(). I'm rather new to jQuery and I am wondering if there is a better way to write the following code. I am using a lot of Traversing methods, (i.e. next(),
[jQuery] jQuery.validate not working properly?
If I leave all the fields blank, the errors show up as they should. But if I correctly fill out even just one of them, the form gets submitted. Why is this happening? Here's the JS: <script type="text/javascript"> $(document).ready(function() { $("form").validate({ rules: { email: { required: true, email: true }, fname: { required: true, minLength: 2 }, lname: {
[jQuery] onmouseover show div, then remove onmouseout
Ok, this sounds easier than I think it is. I have a top nav item called Gallery, and when you mouse over it, I shows a hidden div, which acts as a floating dropdown for the Gallery nav item. These are two separate elements, so when I add a onmouse out event, moving the mouse from the nav item to the div will make the div disappear because there is a gap between the two. Is there any way to make these work seamlessly together? Basically I want it to work like a large drop down menu, but the menu part
FadeIn / FadeOut - How do I loop?
I currently have the following code, that fades in and out of 5 list items and works exactly as I want, although I must confess I am a JQuery newby and the following code could probably been done a lot cleaner. <script type="text/javascript"> var $j = jQuery.noConflict(); $j(document).ready(function() { $j('#title1').fadeIn(5000); $j('#title1').fadeOut(5000, function () { $j('#title2').fadeIn(5000); $j('#title2').fadeOut(5000, function () { $j('#title3').fadeIn(5000); $j('#title3').fadeOut(5000,
[jQuery] jcarousellite: problem finding current position when visibility is a fraction
i'm modified jcarousellite to have indicators that are updated based on position of the element. it works as desired when i set visibility to 1 but when i use fractions (2.75) it perform the function correctly. can anyone help point me to the problem with my code? thanks this is the function to update indicators: function update_navigation(curr){ var kids = $(o.panel); var cloneVal = (o.circular) ? 2 : 0; var pos = (kids.size()-cloneVal
Measuring height of a div - broken in IE
Hi I'm measuring the height of a div to do an animated show hide effect where a portion of the div is always visable. To collect the height I'm using var _startHeight = $("#swatches").css("height"); This works fine in firefox passing through a number, but in IE it passes "auto" breaking the rest of my script. Any thoughts would be gratefully received. I have a test page up and running at http://www.shopcreator.com/mall/productpage.cfm/AnnaMorgan/_BacallLS/256993/Bacall%20Extra%20Large%20Sofa Click
[jQuery] [OT] jQuery
Sorry for OT but just wanted to say a big thank you to the jQuery team and all the wonderful people who contribute in this group. What a great framework! Cheers, Cam Developer Doubleclique <a href="http://www.doubleclique.com">www.doubleclique.com</a>
[jQuery] Slideshow
I’m looking for someone to do a little work for me and I wondered if one of you might be able to help. What I am essentially trying to achieve is a sliding thumbnail viewer with lightbox effects ultimately for use within Joomla 1.5. Essentially what I want to combine is the lightbox enlargement technique from here (http://www.huddletogether.com/projects/lightbox2/ #example) with the thumbnail (only) sliding effect from here (http:// sorgalla.com/jcarousel/ or http://smoothgallery.jondesign.net/showcase/timed-gallery/
[jQuery] UI/Tabs Losing selected tab on updatepanel postback
Hello I've got some of the UI/Tabs (which are very nice, really like them) on a page that is encased in an UpdatePanel. On doing a partial postback, the selected tab reverts to it's initial state (ie, if I do a partial postback from tab #2, it reverts to displaying tab #1). Has this been sorted already? Many thanks, P
[jQuery] ~ selector is not selecting siblings
I have a table that has a list of songs - one for each row. I also have a select menu that populates the song table data from an AJAX query based on what was selected. The first row of the table is a row (#NoSongs) that just says "No songs were found." in case no records were returned. And I just hide and show that depending on the results. Whenever the select menu is changed, it calls a function where the logic is like this: function ChangeSongs() { $("#NoSongs ~ tr").fadeOut('slow',function()
[jQuery] radio buttons and php
I don't get this to work. Somehow the PHP code is ignored within the radio input forms. Can I change PHP variables within the code and work with them in the according #div? Does anybody have a hint? Thank you! jQuery: $("#input-l:input:radio,#input-c:input:radio").click(function(){ if ($(this).is(":checked")) { $("#div").show(); } else if($(this).not(":checked")) { $("#div").hide(); } }); radio buttons: <input type="radio" id="input-c" name="user-type" value="1"
[jQuery] AJAX help please
Here is my code: $(document).ready(function(){ $('#submiter').click(function() { var sites= ["12seconds","brightkite","colourlovers","corkd","Dailymotion"]; var username = $("input#username").val(); for (var i=0;i<sites.length;i++){ $.ajax({ method: "get",url: "boo.php",data: "site="+sites[i]+"&username="+username, beforeSend: function(){$("#loading").show ("fast");}, complete: function(){ $("#loading").hide ("fast");}, success: function(html){ $("#"+sites[i]).html(html); } }); } }); }); On this
Lightbox Issue
Hi everyone. Looks like I found the right place to get some help. Here is the site for reference. http://adgrouponline.com/redesign/index2.htm Anyway, I am fairly new to jQuery and I have been stuck on this issue for the good part of this afternoon. I am trying to incorporate the lightbox feature on three images. I am certain the problem lies in the fact that I am already using another script on the "Featured Work" section. The script allows me to load from three different HTML files using the DIV
[jQuery] Trigger event for children on parent element remove event
Is there a way to trigger an event one element when another element is say, removed or hidden? In other words, maybe a way to register any number of elements to another element with callbacks to be called when a certain event occurs to the main element.
[jQuery] 'Object Required' IE8 Error in jQuery Form Plugin
I think IE8 has a problem with this line: var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value; Anyone understand this error and how to fix it?
[jQuery] problem with using .each() in forms validation
I'm using .each () for form validation , with dynamic form elements, and here's the JS function : function validate_form() { $("select[id^='products']").each(function(){ if(this.value == "0") { alert('MESSAGE1'); document.getElementById(this.id).focus(); return false; } else if(this.value==14 && document.getElementById ('address').value == "") { alert('MESSAGE2'); document.getElementById('address').focus(); return false; } }); $("input[id^='amount']").each(function(){ if(this.value == "" || this.value
[jQuery] tbody:first-child & thead
Hi all,<div> </div><div>I have a code that counts the number of rows in a table...</div><div> </div><div>the table looks like:</div><div> </div><div><table id="myTable"></div><div> <thead></div> <div> ...</div><div> </thead></div><div> </div><div> <tbody></div><div> <tr></div><div> ....</div><div> </tr></div><div> </tbody></div><div></table></div> <div> </div><div> </div><div>and my jquery looks like:</div><div> </div><div>$("#myTable tbody:first-child tr").length;</div><div>
[jQuery] Clone Line and Increase Number by +1
Hello, I relatively new to Javascript in general, but I've been attempting to use jQuery for a while, I ran into a snag today and I hope someone can help, here is what I have so far: var id = $('#invoice_line_item_rows .item.description textarea').attr ("id") $("#add_line").click(function() { $("#invoice_line_item_rows").clone().appendTo ("#invoice_line_items").effect("highlight", {}, 600, function() { $(id).replaceWith("invoice_lines_attributes_new_" + $(this).val() +1 + "_description"); }); });
Adding "easing" to cool function
Hi guys and gals! I'm totally new to jQuery. Moved on to it from MooTools today just because I want to figure it out before it's being released with ASP.NET. I'm making a menu with thumbnails that kinda "follows the mouse". You can see it at http://test.lightboxone.se. I would like to add some easing, smooth effect, to the "mover" but I have absolutely no idea how I'm afraid so now I'm turning to you. If I add the effect directly in to the function, well ... It breaks it. The code for the "mover"
[jQuery] Help validating dynamic form elements
Hello, I'm a bit new to jQuery. I have a dynamic form which could contain any number of input boxes (from 1 to 13) named attrib1 thru attrib13. I need to ensure at least one of the input boxes gets filled in - there again it can be any of the generated boxes. Don't suppose someone can help get me started? TIA
[jQuery] load() not loading my dynamic page
When I use load(), it works fine for static pages but doesn't seem to work for my dynamic page. This is what I'm doing: $('#mydiv').load('my/page'); FireBug shows that the response is coming back just as it should. Any thoughts?
[jQuery] jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()
Hi all, I am using jQuery Form Plugin to submit a form to my php. I am using ajaxSubmit to achieve the same. But when I used it like this, --------------------------------------------------------------------------------------- $(document).ready(function() { var options = { target: '#output2', beforeSubmit: showRequest, dataType: 'xml', success: showResponse, url: 'index.php' }; $('#myForm').submit(function() { $(this).ajaxSubmit(options); return false; }); }); -------------------------------------------------------------------------------------------------------------------
[jQuery] Using load() to call pages..
Hey all. I have a page with 5 buttons and each button calls a different html page. On click of each button, I'm checking security permissions and then I need to call the html page associated with that button. Is it possible to POST with JQuery without having to set the action of the form? Currently, I have a form for each button with the action populated with the program that is to be called. Is there an easier way of doing this with JQuery? ....
[jQuery] Simple JCarousel Issue - Scroll
Hello, Whenever I set the number of items that I want my carousel to scroll through to any number (besides the default '3'), the carousel stops working completely in IE and still displays only 3 items in Firefox (though it still works). <script src="/jquery-2009-01-28.js" type="text/javascript"></script> <script type="text/javascript" src="jquery.jcarousel.pack.js"></ script> <link rel="stylesheet" type="text/css" href="/_template/carousel/ jquery.jcarousel.css" /> <link rel="stylesheet" type="text/css"
[jQuery] jQuery 1.3.1 + jQuery UI 1.6rc6 --- AJAX problem
Hi all, I'm trying to use jQuery to send forms to a PHP script, but I've encountered some problems: - with $.post it works only with an alert just after the $.post instruction - with $.ajax it works without that alert only with async:false option - with both methods it works only with text datatype, but not json datatype the problem is about success (and error) callbacks that are not called properly, but the PHP script it's correctly called. CODE___ /*$.post('include/saveconf.php', serialized,
[jQuery] Superfish - inline submenus
I created a 3 Level Menu based on the example of the superfish page - this works without problems.. Now i want to show the third level inlined in the 2nd level - just CSS work - but there's the problem - the 2nd level should move down while showing the third level... Can you help me with this issue ? Thx in advance for your help..
[jQuery] jQuery.height() or css issue?
So I have been trying to figure out this issue for a few days now. Forgive me if it's something super simple that I am missing. I have a super-simple XHTML 1.0 transitional page (that validates), using Eric Meyer's CSS reset, and loading the latest jQuery from Google's site. Then I have two simple divs inside a container div (nothing floated) and above the container I have a div with a paragraph in it that gets appended with the height of each of the two divs upon document load. The thing is I am
[jQuery] What can we use in place of $.browser?
Having just upgraded to 1.3.2, I've realised that the $.browser utility has been deprecated. Does this mean it is no longer possible to identify which browser is being used?
[jQuery] jQuery.height() or css issue?
So I have been trying to figure out this issue for a few days now. Forgive me if it's something super simple that I am missing. I have a super-simple XHTML 1.0 transitional page (that validates), using Eric Meyer's CSS reset, and loading the latest jQuery from Google's site. Then I have two simple divs inside a container div (nothing floated) and above the container I have a div with a paragraph in it that gets appended with the height of each of the two divs upon document load. The thing is I am
[jQuery] Issue with addClass and removeClass
Below is my complete page. I have two divs, one with class 'large' and one with class 'small'. When you click on the div with the 'small' class, I want to change it to 'large' and vice versa. The classes seem to change as I alert() the small or large class values and they seem correct BUT the div seems to stay bound to the original click function even though the div should/does not have the small class anymore, the .small.clcik event is getting called. Any help would be appreciated. I am sure I am
[jQuery] Calling HTML pages using post...
Hey all. I have 5 buttons on a page, each one calls a different HTML page. Currently, I have each button in its own form and on click, I'm checking permissions and then submitting the form. Is there an easier way of loading a page via post using JQuery? ....
[jQuery] Building functions (newbie question)
Hi, I have some jquery code within the $(document).ready(function() { $("input:checkbox").click(function(){ .... check if checked or unchecked.... ... do some ajax stuff ..... .... do some css class exchange stuff ...... }); }); (This is the function to manipulate my code on a single checkbox event) The ajax part and the css class stuff I want now to "surround" as function in order to use it in another function: $(document).ready(function() { $("#paradigm_all").click(function(){ var checked_status
[jQuery] jQuery Form Plugin not working in Mozilla 3.0.6!!
Hi, I just downloaded jquery.form.js from http://malsup.com/jquery/form/#download The following code works fine in IE (The returned XML from server is displayed through alert() ) But when I use the same code in Mozilla 3.0.6, It fails. ( I am getting redirected to the sell.php5 page ) Can anyone help me please? Thanks, Antony Johnson And here is what I wrote ------------------------------------------------------------------------------------------------- <head> <script type="text/javascript" src="jquery.js"></script>
[jQuery] Expandable Sub Tables
Hello Guys, I've done a little work with expandable div's using slideDown() and slideUp(), I'm guessing I'll be using these again for this challenge but I'm having a little trouble traversing to the correct elements to enlarge and expand and was also a little unsure as to which I should be giving ID and Class attributes. I have the following markup: http://pastebin.com/m2dec600d You'll notice that I have a main table and for each row of data below is a nested table which contains subdata. I want
Next Page