I've struggled for about three hours with a strange ie7 bug. It's a simple animation (of a div with a height of 6em), looking like this .animate({height: ghostHeight}, 250, function() { ... }); and it works fine everywhere except ie7 that says "invalid argument". If i take away the interface (running on 1.2) it works. It seems to somehow complain that height isn't initialized correctly or something, because any other attribute will do (like width), and if I add this $(self).height($(self).height()); the bug disappears. just thought I should mention it, I don't understand (and I'd rather not have that extra line of code) andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I have a jquery selection of input tags of type checkbox, I want to filter out those that are checked. Feels like it should be something easy like $('input[@checked=checked]', checkboxes); andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I bind a click event to a checkbox and check it's checked status (with this.checked). The problem is that the checked status is different depending on whether the trigger comes from an actual click on the element from the user, or if I trigger it programatically with trigger. Anyone solved this? sample code $(checkbox).bind('click', function() { alert(this.checked); // different if user clicks or if I use $ (checkbox).trigger('click') }); andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
that is, a paragraph with some links in it. I bind a mouseout on the paragraph, then bind mouseover and on the links. Now as I move my mouse over the different links, the p.onmouseout gets triggered all the time, even though the links are nested inside it, I thought that wasn't suppose to happen, or is it just the .hover that behaves differently? What I would like is the p.onmouseout to only trigger once I leave the paragraph, not for every link I leave. Now I seem to remember this as normal JavaScript behaviour, but I thought I read somewhere that this had been coded around in jQuery? andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
$(element).attr('scrollHeight') does not work (returns undefined) but $(element)[0].scrollHeight does, is this right? andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Hi, I'd like to wrap three siblings into a div, sort of like <div ...> <textarea ...> <div ...> and transform it into <div> <div ...> <textarea ...> <div ...> </div> these three siblings also have more siblings that I want to leave out of the loop, so it's not entirely straightforward. Any ideas? Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Am I daft or what, I'm trying to change some global ajaxSettings like so $.ajaxSetup( {contentType: 'text/xml'} ); but it seems to not work. $.ajaxSetup is not a function firebug tells me ... Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I'm trying to do a $.getJSON, and in FF it works just marvelous and does a GET request. The exact same code in IE seems to trigger a POST request, which is bad news for us since the java-server side seems to read in the parameter twice (one from the ajax call itself, and one from the form-element), resulting in an array instead of a value for the parameter. So, short question really, anyone else know about this behaviour of IE doing POST instead of GET för ajax stuff? Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Is there a way to break the $.each loops? I'd like it to be $.each(object, function() { break; }); but it doesen't seem so. Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I have an li-element with some divs inside it to round the corners (2x2 pixel divs with suitable background images to just chip off the border around the li) I use the built in animate to change the height of the li, during the animation, the divs don't work as they should, but as soon as it's over, they "hop into place" functioning like they should. I'm quite sure this comes from a z-index problem, since when I remove the li-border, the "chip-images" stay in correct position, it seems that during the animation, the border gets a higher z-index than the "chip-images". Is this a known problem of sorts? Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I've recently moved from prototype to jquery, and wonder if there's something simmilar to Position.clone. That is, match an arbitrary elements position exactly, (with all the offsets and parents and so on, it's more to it than just match top and left attributes) I googled a bit and came up with a test case on the jquery side for the prototype code, which I found somewhat interesting. Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I suppose this touches on off topic, but ... is it possible to remove an entry completely from a JSON hash? say I have { firstString: 'first', secondString: 'second' } and evaluate this into a json object, and I want to remove firstString, could I do something like json.remove(json.firstString); ? Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I discovered that the meta-data plugin wasn't all I wanted, so I wrote a very small plugin to store and fetch json from the class attribute. $(element).json() will return a json-string stored in the class attribute from the first matched element $(elements).json(string) will set the json-string in the class attribute for all matched elements comments as always welcome :) Andreas code: jQuery.fn.json = function(value) { if (typeof(value) == "string") { return this.each(function() { if (this.className.match(/\{.*\}/)) { this.className = this.className.replace(/\{.*\}/, value); } else { this.className = this.className + ' ' + value; } }); } else { return (eval('(' + this[0].className.match(/\{.*\}/) + ')')); } }; _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
In the name of unobtrusive scripting, I like to store different key/ value things in my class attributes, like <input type="checkbox" class="checkBlur target-input1-input2-input3"> in this case, the checkbox would blur elements with ids of input1, input2 and input3. So I use a dash-separated list to build an array of values, with the first value being the key. Now, you may criticize this behaviour if you like (and really, I'd welcome it) but my main thing here is to ask about a little plugin i wrote after just going over to jquery for handling this. I wanted to be able to get the value of such a classValue, change it, and clear it. First I thought of having three different functions, getClassValue, changeClassValue and clearClassValue but for some reason I didn't really want to clutter the namespace with three different functions, I wanted something quite slick, and since I almost exclusively use this functionality to just get an array with the values, I thought I could have just classValue, that always returns the values (of the first object found) and then pass in options for changing and clearing if desired. Like this $(element).classValue('key') to get values $(element).classValue('key', {newValue: [array]) to change values $(element).classValue('key', {clear: true}) to clear values What do you think? Is it bad to include this extra functionality as options? Andreas The code (if you find it useful, please do mention any errors) jQuery.fn.classValue = function(key, settings) { settings = jQuery.extend({ delimiter: '-', clear: false, newValue: false }, settings); if (settings.newValue) { settings.clear = false; if (typeof(settings.newValue) == 'string') { settings.newValue = [settings.newValue]; } } for (var i = 0; i < this.length; i++) { var classAttributes = this[i].className.split(' '); for (var j = 0; j < classAttributes.length; j++) { var values = classAttributes[j].split(settings.delimiter); if (values[0] == key) { var ret = values.splice(1, values.length); if (settings.newValue) { $(this).removeClass(classAttributes[j]).addClass (key + settings.delimiter + settings.newValue.join(settings.delimiter)); } if (settings.clear) { $(this).removeClass(classAttributes[j]); } return (ret); } } } return (false); }; _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
There seems to be a bug for the tablesorter plugin in IE6. When I assign a sortColumn (integer or string) I get a error message saying 'null' is null or not an object (translated from Swedish) The offending line seems to be 173, IE6 seems to complain about the way the sorting gets fired. Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
I've just begun using jquery, and wanted to set the disabled attribute on a input element. I have a string with an id value, and so I thought $('#'+string).disabled = 'disabled'; would cut it, but it seems I can't access normal DOM attributes just like that (I have to confess, I've used lots of prototype where I could do $(string).disabled = 'disabled';) so I changed it to document.getElementById(string).disabled = 'disabled', and this worked, but it didn't feel good. Is there another way, am I supposed to use the $.attr perhaps? like $('#'+string).attr('disabled', 'disabled'); and is attr the way to get all the attributes of dom element, would seem so :) this does seem to be the case, just wanted to ask and receive best practice Andreas _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/