Fire an event uppon img load
I tried sticking onload html attribute on the img elements, but that wasn't compatible with the older versions of opera and was invalidated by the w3c validator. This is the second route I've taken: $(document).ready(function() { $(".dlPicturesImg").load(function() { fadeTmb(this); }); }); ...but it doesn't work as intended, I would like the fadeTmb function to be called as soon as an image loads. Things are possibly being complicated by the fact that
:not code doesn't seem to work.
I'm currently studying off the book 'Learning jQuery : Better Interaction Design and Web Development'. In the book is this code: $('tr:not([th]):even').addClass('even'); Which they say will select all tr tags that don't have child th tags. Well that's what they say, but I'm finding that the class name 'even' is still being added to tr tags that have a child of th. It's not a particularly big deal, except that I'm trying to understand the fundamentals of jquery, and so now I'm not sure how you would
[jQuery] Working with Arrays
Hello, I use some jQUery functions, to work with Array. But now I'm missing a function. How can I remove an item from an Array? Lets say, I have this Array: var a=[ 1,2,3,4,5,6]; And now I want to remove item 3. How can I do this? Thanks for your Help, Stefan Sturm
[jQuery] how tu use jQuery.getJSON in synchronous mode
I try to use jQuery.ajax with dataType : 'json' : jQuery.ajax({ url : "poll.json", dataType : 'json', cache : false, succcess : function(jsonObj, textStatus){ ........ }, error : function(XMLHttpRequest, textStatus, errorThrown){ ......... }, async : false }); it seems not running
[jQuery] Validating reCaptcha using JQuery before sending via $.post
Hi, Is there a way to validate a visitors reCaptcha input using JQuery before sending the form? I can't see any way I can do it. Can anytone help? Thanks
[jQuery] Problem with animate callback
Hi, I have function which animates div#square and insert link in this div (via animate callback): function resizeSquare() { var $square = $('#square'); $square.animate({ width: "300px", marginLeft: "-150px"}, 800) .animate({ height: "400px", marginTop: "-200px"}, 800, function() { $(this).html('<a href="#" class="clicked">clicked</a>'); }); } and then I want to display alert after click on this inserted link. This is a function doing this: function showAlert() { $('a.clicked').click(function()
[jQuery] How do I get the actual HREF of a link?
Here's the short version: I have a link: <a id="testlink" href="page.html">page.html</a> But when I do this: alert($('#testlink')[0].href); I get this: http://localhost/page.html How do I get the *actual* HREF of the link ("page.html"), and not the mangled version? Thanks! ---------- The long version: I have a few links in HTML: <a href="/page1.html">/page1.html</a> <a href="http://localhost/page1.html">http://localhost/page1.html</ a> <a href="http://localhost:80/page1.html">http://localhost:80/
[jQuery] How to display tips by creating a jQuery plugin
Hi there! One more tutorial to share with you guys... We are going to learn how to create our custom jQuery plugin to show tips on mouse over event on our desired elements. We will also be able to customize the appearence of the tip division for each kind of elements in the CSS code and much more: http://yensdesign.com/2009/01/how-to-display-tips-creating-jquery-plugin/ I hope you can use it to improve your projects as always :D
[jQuery] [autocomplete] IE7 Problems Multiple Autocomplete
Hi Guys! I am currently using the Autocomplete plugin by Jörn and its awesome! However, I have problem when I try to use multiple autocompletes in one page. There is one <input>. I bind it when “document.ready” fires. It’s works perfectly. function BindAutosuggestControl(id, urlAction, resultId, formatFunc, parseFunc, selectFunc) { $("#" + id).autocomplete(appRoot + urlAction + '/', { dataType: 'json', minChars: 1, matchSubset: 1, autoFill: true, matchContains: 1, cacheLength: 0, selectFirst: true,
[jQuery] change certain elements in result set based on position
Hello all, I can't quite get my head around how to accomplish this and any guidance would be greatly appreciated. Say I have some random number of <h1>'s on the page, like 20. I'd like to grab the first 4 and make them red, then grab the next 4 and make them blue, then grab the next 4 and do something else with them, and so on until I reach the end. I've been looking at .each() and some of the array functions, but I can't seem to piece it together. Thanks, Michael
[jQuery] Select Display image
I am looking for a jquery plugin which allows me to select an image for display. I want something similar as MSN messenger provides for selecting display image. When I click browse button an image gallery open up in a popup which should display uploaded images with proper directory structure. I select one of them and display it on Parent html page. Is there any thing closer available in jquery? Thanks.
[jQuery] Problem with animate callback
Hi, I have sth like this: function resizeSquare() { var $square = $('#square'); $square.animate({ width: "300px", marginLeft: "-150px"}, 800) .animate({ height: "400px", marginTop: "-200px"}, 800, function() { $(this).html('<a href="#" class="clicked">clicked</a>'); }); } In second animate function I use callback to insert link in div#square. And everything is ok. Then I want to display alert after clicking on this link, but nothing happens. This is function which should display
ajax submit without site refresh
hey guys im new here =) so i have a question i wanna change the forms on my page to a ajax submit so a submit without a siterefresh i have searched but have not found any demo can someone post a easy understandable demo for me? thx sry for my bad english
[jQuery] Name Panels instead of calling them by #number
Hi, is there a possibility to really name the panels somehow? I would like to have links like this: <a href="#contact" class="cross-link" title="contact"> with the anchor inside the associated div. to get the side easier to search for searchengines.
[jQuery] Table sorter and pager problem
Hi I am using these plugins. But my problem is firefox related. while sorting I can see small images in header of table in IE(images on which we click and do sort ascending and descending ) but when I open same page in firefox it does not show images .... Any idea ? Also, there are some fields in the table where nothing is written so I am using Jquery to put "NA" where nothing is written. But it only does this on 1st page where I am showing only 10 rows.... Now suppose through my pager I change the
[jQuery] Custom Events and Propagation
I am trying to define a custom event that may or may not fire after a given mouseup event. I want it to be bindable to any element but now this is causing problems with jQuery 1.3 custom event propagation. My current implementation is something like this: jQuery(function() { jQuery("*").mouseup(function() { if (conditionsMet) jQuery(this).trigger('customevent', [customData]); }); }); This works more or less as expected in 1.2.X, but in 1.3 it ends up triggering multiple times per click because if
[jQuery] How to resize div for new content with load?
Hi all, i use a menu for loading new content inside a content div, so far so good. Most of the time i have to load a big table, which is higher then the content div. In this case the footer div does not go down, my content div does not resize his height and goes through the middel of my table. Not sure if this is a jquery issue or a css issue Menu code: $('.sub li a').click(function(){ // test alert //alert("clicked on sub item.."); var toLoad = $(this).attr('href'); // test
[jQuery] .change alternative
Hi, I'm using a .change function to find out whether a radio button or not is selected by the user. I then show() or hide() other fields according to which radio button has been selected. Now, the problem arises when someone clicks on the reload button of the browser, or if some php validation returns to the form, some fields remain hidden because the .change function has not been triggered. Is there a way to detect which radio button is selected - before any user input? I'm thinking of something
[jQuery] clone()
This sentence totally freaks me out... "Create a button that's able to clone itself - and have the clones themselves be clonable."
[jQuery] getJSON how to manage objects.
hello, i have another question about JSON i received the JSON Objekts well, so my question is i receive an object like this data.items this has html in it. how can i talk to an html object $('#test') that is in the JSON Object. do i have to inject the html first by $('#putitthere').html (data.items) and then talk to it? Thanks for your replies
[jQuery] Move element after Fade
Hello, I'm trying to write a script to move a <li> element from one unordered list to another after it fades. Here is my code, I can get it to fade but not move. If I remove the fade I can get it to move correctly. Thanks for the help. $(document).ready(function(){ $(".color").click(function () { $(this).fadeOut(1000,function(){ $(this).prependTo("#chosen_colors"); }); }); });
[jQuery] Filter elements with multiple classes.
Hi, I've got a bunch of thumbnails, each with a category and a client name as a class. For example: <ul> <li class="category1 client2">Thumbnail</li> <li class="category2 client1">Thumbnail</li> <li class="category1 client3">Thumbnail</li> <li class="category2 client4">Thumbnail</li> </ul> I need to create a way of filtering those thumbnails using a class. For example, I click on the button to show all thumbnails by client2 and hide everything else. I've tried using the [class!=client1] filter, but
[jQuery] error with selector using jquery.ifixpng2.js and jquery v1.3.1
hi, there comes an error with the following selector... i'm using jquery.ifixpng2.js or (jquery.ifixpng.js) and jquery-1.3.1.min.js $('img[@src$=.png]').ifixpng(); Exception... "'Syntax error, unrecognized expression: [@src$=.png]' when calling method: [nsIDOMEventListener::handleEvent... what is wrong with this selector? best regards m from cologne
[jQuery] jQuery Slide functions issue
Hi there. I found out (and probably you all did) that sometimes jquery slideUp, slideDown and slideToggle functions may be a bit choppy. I think it's something about the padding and heights that causes the problem, but if anyone knows how to fix this problem i would be grateful to hear it. Thanks !
[jQuery] jcarousel problem with disabled next button in safari
Hello, please check out http://www.mirox-media.com/blog_add/media/data/film_festivals.html. It works fine in Firefox 3.0 (on Mac), but it has some very weird problems in Safari. The first time you load it in safari, the next button is disabled. Then, only if you click on the "refresh" button in the safari browser a couple of times, it works.. Why that? Thanks for answers, Matthias
[jQuery] Accordion?
I'm new to jQuery so I have a noob question. What´s the plugin to do the horizontal scroll similar to this site? http://lukelarsen.com/ I search for accordion on the official site but I can´t find anything. Sorry for the noob question Thanks in advance
[jQuery] Bug in FAQs for checkboxes
Hi, after some painful debugging, I determined that there is a bug in the jQuery FAQs about how to clear a checkbox. Specifically, if you have a strict XHTML document, you *cannot* use .attr("checked","") to clear a checkbox. Instead, you must use .removeAttr("checked"). See the following PHP code sample: <? header('Content-type: application/xhtml+xml'); print '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Sortable update event never fires
OK, I'm frustrated, and feel like I'm missing something obvious. Dragging and reordering works fine, but my update event never fires for the following sortable: <div id="PhotoList"> <div id="l_05198fad-f1dd-43bb-a458-29358167e932" class="photoItem"> <div class="handle"><img alt="" src="ThumbHandler.ashx?fileid=05198fad-f1dd-43bb-a458-29358167e932"/></div> </div> <div id="l_bc1b522c-36e7-44c0-926d-7f8bdf82c580" class="photoItem">
[jQuery] JQuery Cycle Plugin: 2 tiny glitches
Hello Can someone help? I have two problems. Both I think are tiny. First problem: I'm almost done successfully installing the Cycle plugin. If you use FireFox to go here: http://acuitas.com/index.php then click on the Refresh button, you'll see it works great. Please tell me why I need the refresh button? Second problem: Now load http://acuitas.com/index.php in MSIE. As you see, it just loads the images in a long ribbon down the page. What's that about? Thank you. :-) All the best to everyone.
[jQuery] How do I show the label text in an input
Hi, Apologies for this noob question, but I really need help and I have tried numerous techniques to get this right. A client has asked me to create an accessible form that has text describing what to put in the input area shown within the input. However, they don't want a label above it. To keep the form accessible, I've created a class that positions the labels in the form -9999px to the left and used JQuery to add that class to the labels so they are visible if Javascript is disabled. However,
[jQuery] jBind 1.5.0 (add action when binding data to template)
jBind is jQuery plugin for binding any complex data to templates in an easy way. By using $(template).bindTo(data) you can bind your data to the template. This version 1.5.0 allows you to define your own function and apply it during binding.So you can treat a special item in your aggregate object differently. Find out more at http://arashkarimzadeh.com/index.php/jquery/11-jbind-jquery-bind-template.html Arash Karimzadeh http://www.arashkarimzadeh.com
[jQuery] Using swapImage plug in generate border when clicked
Hi, I am using jquery.swapimage.min.js: http://www.morvimmer.com/wp/ for one image ("Blog" on the top main menu). When I click on it, I have a blue border, and when hover, I have a red border, both in FireFox mac and PC, Opera and Safari. In my CSS I have removed all appearance for such behavior. Anyone have any idea why it happens? Thanks, Mor
[jQuery] Would someone pleae tell me what's wrong with this syntax?
Hi, all... I keep getting this error from Firebug: syntax error .trigger('change'); \n for this code: $(document.ready(function() { $('#select').change(function() { var newName = ''; $('select option:selected').each(function() { newname += $(this).text() + ' '; }); $('#name-div p').text(newName+' [Change]'); $('#name-div').fadeIn(500);
[jQuery] selector for children of specific element?
I need to run thru a table and do something for all rows that have a checkbox that is selected. I have to collect values from several columns in that row. Is there a way in jQuery to find child elements for a specific DOM element or jQuery wrapped set item? Thanks very much. I'm just getting started, but really enjoying jQuery, -- Chris
[jQuery] Problems with creating a pager effect with a kwicks nav
Hello all, I created a Kwicks style nav and I am trying to make each of the buttons fade in a certain area of content. Each of the buttons fades in their areas correctly, but after I hit one button, it won't do anything when I hit another button after that. I'm pretty sure it has something to do with the jquery code that is effecting the fading in that the area is told to fadeOut and after that won't fade back in after clicking another button. Here's a page with the problem: http://idea-palette.com/testfolder/pagetest3e.html
[jQuery] Problem showing a forma with Tiny_mce textarea
I have a div wich is showed when the user clicks a button. The div have a forma with a textarea when tiny_mce is. But when the form is showed, I cannot write to the textarea and firefox throws me "t.win.document is null". In IE works well. What can I do, I have already tried to do this (http:// blog.mirthlab.com/2008/11/13/dynamically-adding-and-removing-tinymce- instances-to-a-page/) but doesnt works. Thanks in advantage.
[jQuery] Loop through array with animating each element
Hi Guys, Is there a way to loop through an array while i insert the elements into a div and animate it. THe scenario is like i want a slide show of text inside a div. So the div with id "tweet" gets update with array elements after 5 secs. This is waht i come up with, i know it may be a total mess, but i am the new one here .. a={0,1,3,4,5}; $(document).ready(function(){ jQuery.each(a,function(){ $("#tweet").text(this.text); setTimeout('$("#tweet").slideUp("slow")',2000); }); }); <div id=tweet></div>
[jQuery] $.live and performance
Hello. Sorry about my grammar, English isn't my tang. I want to understand how the "$(selector).live()" works. I have a DOM with a lot of elements. So if I write: $('span[attr=value]').live('click').. When jQuery search for this SPAN? jQuery search immediately for all span[attr=value], or every time that I click on any element jQuery check if it span[att=value]?
[jQuery] Callback function not working
Hello, I have a callback function belonging to a $.post that won't work. Anyone know why? This is my function: function(date) { $("#date_"+$(this).attr("id")).html("Updating.."); $.post("includes/updateleverans.php",{id:$(this).attr("id"), date:date}, function (data) { $("#date_"+$(this).attr("id")).html("Done!"); }); } This is my php: <?php include ("db_connect.inc"); $date = str_replace("-", "/", $_POST['date']); $id = $_POST['id']; mysql_query("UPDATE prot_orders SET due_date = '$date' WHERE id
Why document.ready doesn't fire in IE 7
This is actually a fix for a fault that was troubling me for a while - I thought it might help others if I post it. It seems really simple but I have searched and can't find any reference to it. When you import the JQuery file in your page you might think you could do it like this: <script src="jquery-1.3.1.min.js" type="text/javascript" /> or like this: <script src="jquery-1.3.1.min.js" type="text/javascript"></script> and it wouldn't make any difference. But in IE you must use the second form (using
Next Page