Demo:
http://nonsponsored.com/cart_demo/minicart.html
I see what you are talking about in IE6...the slidedown happens in waves. It
seems like each element of the enclosed table appears in a burst, followed
by a short pause.
I don't know if it would help, but the markup there looks a lot
Not seen a plugin that does this yet. Would try it myself, but not
sure how to do so (even after looking at existing implementations).
http://www.designdetector.com/demos/css-gradients-demo-1.php
The basic implementation of that page similar to the rounded corner plugin I
did. It's much worse
To disable the buttons i use $(#myid).set({disabled:disabled});
This part works perfectly fine, but how do I remove the disabled
tag again from #myid to enable it?
The latest SVN version can do it with .attr({disabled, false}) or
.attr(disabled,) but some older versions had a bug that
How would i go about making a table and then inserting rows
in the body in a for loop. I am wanting to create a stats board for
a post match. I figured i would create the table and then append
to it am i right in how to go about this? How would i append to a
tag in the table i just created?
I tried to use location.href right after the $().show()
If the animation isn't done then the form isn't showing yet and you probably
can't scroll to an anchor in it. Maybe something like this?
$(p).show(slow,function(){
location.href = #whatever;
});
The completion function is supported
http://laurens.vd.oever.nl/weblog/items2005/closures/
Has this been found to be an adequate solution to this issue?
(mainly for non jquery code)
Yes, it solves the IE closure problem very nicely. My closure
plugin for jQuery uses a modified version of this code.
Yipes! I just did a
Do events need to be unbound from dom
objects?
I
think they do, seethe Closures thread.
Is there a way that I say loop through my content
and unattach all
events before replacing the content?
(Essentially a $(object).unbind(); that removes all events)
It
looks like .unbind() with no
$(ullifoo/li/ul).find(li).click(...).end().appendTo(body);
IE6 leaks a small amount of memory if you attach an event handler before
tacking it onto the body:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ietechcol/d
nwebgen/ie_leak_patterns.asp
Probably isn't worrisome unless
It works normally in firefox, so i don't understand why it doesn't in IE5.
Sounds like you meant IE6, it's working fine in IE6 for me (SVN 169 was what
I had handy). What version of jQuery are you using?
Going to jquery.com I did notice that it's very easy to grab an ancient
version of the
That is a good reference. Is there a getting-started-style guide somewhere?
Also, has anyone worked on how-do-I style FAQs or equivalent functions
between standard DOM or other frameworks? If not I can work on some of that.
It might be useful to have the built-in documentation specify categories
$(img).appendTo(this).src( src ).load( f );
if you replace the main line by:
$(img).src( src ).load( f ).appendTo(this);
then the image will display before the alert() fires.
The problem with appendTo being last is that IE will leak memory if you set
certain attributes (such as an
$(#main).append( $(main,xml).children() );
[Exception... Could not convert JavaScript argument arg 0
[nsIDOMHTMLDivElement.appendChild] nsresult: 0x80570009
(NS_ERROR_XPC_BAD_CONVERT_JS)
I've seen that error in Firefox if you try to append a null or undefined
using appendChild.
Dropped jQuery 1.0 (uncompressed) into a work in progress and all my
rounded corners disappeared. Anyone else using the rounded corners
plugin that can verify or potentially offer a fix?
Starting with this code:
http://methvin.com/jquery/jq-corner-demo.html
The original code works fine for me
The solution suggested earlier for executing javascript code
embedded in HTML returned by an ajax call by using
eval.call(window,...) works great in FF, but not in IE6.
How can we change the execution context of eval?
Can you change the way the function is declared?
script
Apparently it's seeing all URLs in their fully-qualified
form, not in the form they are in the source code.
In all browsers, or just IE? That's a quirk of IE that it changes relative
URLs to absolute.
http://www.glennjones.net/Post/809/getAttributehrefbug.htm
I thought there was a
I'm in need of someone to do some freelance work to work on a jQuery-based
project. In particular, I need someone who can add a slick look to the
interface--color choices, slides, fades, that kind of thing. Send me an
email if you are interested, dave.methvin at gmail.com.
Every time you have a '-' in a property, remove it and replace the
next character with an uppercase representation of itself.
Is this documented anywhere though?
If the example in the API reference for .css used a camelCase attribute I
think it would be clear. How do we edit that?
im trying to post via ajax an array of checkboxes with the same
id.
The id attribute for an element must be unique in the
document.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
what about plural functions that would return an array
of the requested attribute values from all of the elements?
Your approach could be generalized for attributes (and css similarly) like
this--untested:
jQuery.fn.attrs = function(n,a){
if ( a )
return
- Disabling Javascript (not CSS) should not enhance behaviour
but functionality AND LAYOUT (CSS) should remain at least.
Any suggestions on defining 'good practises' for css in plugins?
A plugin should fail in a way that causes the least disruption to the page.
The basic jCarousel example
jQuery.fn.swapClass = function(c1, c2){
return this.each(function(){
var t = $(this);
( t.is('.'+c1)) ?
t.addClass(c2).removeClass(c1) : t.addClass(c1).removeClass(c2);
});
}
Also i would like to know if this is the most efficient this code could
be.
As written it will
When writing plugins you're fully encouraged to use the
@private methods - that's what they're there for. I'm
working to document them better for plugin authors, but
you should definitely feel free to use the @private methods.
Ah okay, so @private is more like protected. Good to know so I
Hi, Maybe you could think of adding things like $A, $H,
$S, $L where you could do something like:
$L(['aaa', 'bbb']).each(fn)... would be nice
For those situations, why not extend the Array prototype? It makes for
cleaner syntax.
['aaa', 'bbb'].each(fn)
Array.prototype.each = function(f) {
IE just throws a wobbly:
Line: 639
Error: Wrong number of arguments or invalid property assignment
which appears to reside in the 'attr' function, the line is:
} else if ( elem.getAttribute ) {
Just a hunch, but IE's DOM support isn't native Javascript. If they got
Some of the prototype.js functions which I use quite a bit are:
include(), inject(), collect(), findAll(), and detect() which are
documented at
http://encytemedia.com/blog/articles/2005/12/07/prototype-meets-ruby-a-look-
at-enumerable-array-and-hash
All of those look easy to implement, here
I just ran into a problem getting the border width from elements.
This isn't a specific jQuery problem ...
I don't know, there are some unusual things going on there. I added a few
things to your demo and this was the IE result:
This is #div1
jQuery(s).css(border): undefined (undefined)
As John says, the situation with getting border dimensions on elements is a
mess (like margin and padding) and there are limits to the amount of
lipstick jQuery can put on this pig. Here are the results of my experiments
with jQuery().css() on IE6, IE7RC1, FF1.5, and Opera 9.1.
1) The shortcut
I found a solution to get the border width in pixels independent
from how its assigned. Check the source code at
http://sorgalla.com/test/borders.html
Wow, I missed that...it's like the same swap trick John used to get element
width and height. This should also work for padding, but not for
var a = $H({
a1: [1, 2],
a2: [3, 4],
});
a.each(function(n) {
var v = $H(n).value;
});
how would I do this in jQuery?
What does it do?
$H() is prototype's Hash creator.
http://www.sergiopereira.com/articles/prototype.js.html#Reference.Hash
Here is the
I've got a problem, probably found a bug in jQuery.
The $.load function doesn't refresh the DOM in select-fields when
using IE6 (7 not tested) or Opera(8.5 and 9beta) but in FF it works.
It's a cross-browser issue, arguably a bug in IE (and Opera?), but should
jQuery should try to work around
Under RFC 2695, a user-agent (such as a Web browser)
should provide at least 4096 bytes per cookie - so the
4KB is a minimum for storage - not a maximum. See:
http://www.faqs.org/rfcs/rfc2965 (section 5.3).
Yes, but SHOULD is not MUST.
http://rfc.net/rfc2119.html
All modern browsers do
Sorry. It appeared to be an issue with our corporate network.
They probably blocked it thinking it was a porn site. After it, it has
visual in the name, and everyone going to the site had a smile on their
face...
___
jQuery mailing list
Nice hat!
http://static.flickr.com/52/114431569_4c0c4e1763.jpg?v=0
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Now, in IE6 (at least in my copy) the bottom toggle bar
works fine, so does the comments area - but the top
bar keeps crashing IE6 - however it works fine in Firefox.
Same here. The crash is in MSHTML.DLL, which is bad news. Even if you caused
it indirectly, it shouldn't result in a crash
I wrote a new plugin which can transform an image into a button.
You can check out the demo here:
http://www.webunity.nl/_test/jquery/jButton/
I like the features. It would be better if the markup was a button and the
plugin replaced or changed that as needed. Buttons can have an ACCESSKEY
I can't recall the exact date, but it was almost a year ago. I stumbled
across a post John had made on someone else's Javascript blog describing the
chained function approach, which led me to his own blog post that had the
beginnings of what was to become jQuery.
The unevent can either remove just the handler passed to it as the first
function, or it can remove all events if you pass it no function.
$( #myradiobutton ).attr( onchange, ).change( function() { ... } );
Is the problem that you are attaching a new onchange event, and need to
clear the
Dave Methvin schrieb:
Is the problem that you are attaching a new onchange event, and need
to clear the old one? If so this should work:
$( #myradiobutton ).change().change( function() { ... } );
Afaik that would call all registered change events first, then add a new
one.
Yes, my thinking
var btnCancel =
$(cloned).find(input.frmSpace).clone().attr(type,button).
val(langHash[cancel]).insertAfter(btnSubmit);
If I remember correctly, IE has issues changing input
types from one type to another
Yep.
Remarks: As of Microsoft Internet Explorer 5, the type property is
FYI, you can already call an extra Function argument
on any destructive operation, for example:
.find( foo, ifCallback )
.filter( foo, ifCallback )
.not( foo, ifCallback )
I didn't document this yet, since I didn't think anyone
was going to care to use it, except for me. Heh.
I use it in
John, these are great additions, but please be advised that in some
browsers this.attr('checked', 'checked') won't work as expected.
Do you know which browsers those are offhand? It'll help me to test
the methods, when I make them
I think there are overall inconstencies. I put up a
I rooted around in some Atlas stuff I found on the web and saw some uses,
but not a definition, of their $() function. Do you know where it is
defined?
I'd love to talk our developers out of using Atlas altogether,
but as a designer I lack the appropriate credentials in
this department. ...
As an aside, or perhaps a branch, to this conversation...
I'm a jQuery newbie, and have found it interesting that
callbacks in the system do not seem to get parameters.
In systems that I've used before that provided callbacks,
those callbacks typically got a parameter or set of
parameters
Is there a way to set a variable in an each that will be stored
separately for each instance of the plugin (for example, if I am
performing an action on all inputs, is there a way to store the
input type and reuse it later?). Maybe I'm not being clear, so
here's the example:
$(.rounded).removeClass(rounded).wrap(env(div, test,
{class:rounded}));
I found that the function was being called once
even though no html was generated.
The jQuery object doesn't have any elements, but by the time the wrap method
executes it has already evaluated its arguments, which in
I've developed (or partially developed) a new plugin that implements
webform2's slider. Specifically, you can do stuff like
input type=range step=1 min=1 max=10 value=1 id=a /
and jQuery will automatically convert it into a stylable range widget.
That won't validate for HTML4 or
Regarding the validation:
I designed this around the *new* as-yet-unimplemented spec for
WebForms2. I'm doing this on purpose *knowing* it won't validate
as present. It's a tradeoff I'm willing to make (since it's not like I'm
making up my own spec).
I understand your goal, but
Just to set expectations on timetables, MS said they would eventually push
IE7 out as a high-priority patch a few weeks after general release. So
although tech-savvy users may be able to download the final IE7 within a
week or two--and many already have IE7 RC2--Aunt Abby probably won't have it
Here's the Microsoft doc for it:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/getattribu
te.asp
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I think what he's talking about is whether or not it returns what was
just added to the document or the original element. Another example
would be whether or not .clone() return the cloned elements in the
jQuery set or the original elements. Those sorts of things aren't
listed.
Good
Paul, nice implementation of nifty inside of jquery. Out of curiosity,
does nifty do rounded corners any differently then Dave's plugin?
http://methvin.com/jquery/jq-corner-demo.html
Dave's does have less code involved, doesn't use the GPL (not sure
if a dual license is possible as it is
$(document).load(function() {
Try $(window).load() instead, since you're trying to set a window.onload
handler.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
There are two issues at play here:
1) The collision of method names.
2) The sheer number of methods attached to the jQuery object.
#1 will only be solved through a change in the name of the methods
(for example, from .load() to .onload() or .event.load()).
#2 can only be solved by breaking
So our points of optimization should be on plain tag selectors,
and expressions that return no elements.
-- Yehuda
Let's not get too carried away based on this single benchmark. It is only
checking a few things and I am not convinced they representative of
bottlenecks in real code. For
What Mark is proposing is quite different from what
you're proposing. His function physically creates the
helper methods of .click(), .val(), .href(), .title(), etc.
On a whole, I like the idea - in that it'll make writing the
events plugin painfully easy - but at the same time it'll
Should keep it simple. changing .load to .ajaxLoad is
even unneccessary.
None of this is absolutely necessary. jQuery works as-is, and the changes
may break existing code, so the easiest path is to leave everything alone.
The issue is whether we can make changes to the jQuery API that make it
Here's an idea for the future:
Multiple/alternative selector schemes (ie. CSS3, XPath1, XPath2)
and compilation of selectors into native Javascript.
The thread about benchmarks got me thinking about compilation and caching of
selectors too. It could be a big win for benchmarks where they use
The thread about benchmarks got me thinking about compilation and
caching of selectors too. It could be a big win for benchmarks where
they use the same selector in a loop 1000 times! :-)
The problem with caching is that it's unable to handle situations
where the DOM changes in-between,
Eh I was hoping for some more enthusiasm over this one
as it seems to come up often ... oh well. I didn't make it
as a typical diff style patch ... just need to include the src
(select.js) in your project to make this work and test.
I took a quick look last night but was wondering if it
Mike Alsup has tweaked my original corner rounder so that it does any corner
adornment you'd like, and it's only 4KB. It doesn't support borders or
background images in the parent though, which Curvy and a few others do. But
it's a high price to pay, IMO.
http://www.malsup.com/jquery/corner/
Be
I think we are talking about two different effects here. This can definitely
be subtle so it's good to have someone ask the question.
var cell = $(e);
var cellParent = cell.parent();
var cellParent2 = cell.parent();
...
Further digging seems to hint at the fact that every time
This worked for me:
var data = [div new-one/div, div new-two /div]
$(#links).empty().append(data.join()).children();
You are better off using .empty() because .children().remove() will
pushStack and move you off #links. You can get back with .end() but that's a
lot more time, memory, and
After further tests I realize that most of the time is spent
in getting the height and width of the passed element:
oHeight = e.offsetHeight;
oWidth = e.offsetWidth;
As Brandon says, please post a link to a test page so we can take a look.
I have a group of checkboxes, and as long as any one of
the boxes is checked I need a function bound to a select
list, but anytime none of the boxes are checked I need the
function unbound. What I have below binds and unbinds,
but if I select lets say 4 checkboxes the function is bound
and
I've got an issue with using the Interface idrag.js.
... what I see (using the DOM inspector from the web developer
toolbar for Firefox) is that the node tree is correctly cloned,
except that the value property of the textArea is not replicated.
Hence the cloned drag object has no text in
But, to my mind, it makes sense to do
$('#myElement').parent().parent() because the parent of the input is
a td and the parent of the td is the tr. Or is that wrong?
No, you're right - On first glance I thought it was td id=myElement
...
/td sorry about that. Not sure why .parent('tr')
$(span.readonly input).attr(disabled, disabled);
Does this work?
$(span.readonly input).attr(disabled, true);
The XHTML attribute is disabled=disabled but the Javascript property is
boolean.
___
jQuery mailing list
discuss@jquery.com
I wanted to add the normalization for e.target as discussed earlier.
But I came across a strange bug in Firefox. Have a look at the following
page:
http://stilbuero.de/demo/jquery/etarget.html
If you click on the link the target of the click event (attached to
p) is alerted. In that case
I just found this link
http://www.jackslocum.com/yui/2006/08/19/a-splitbar-component-for-yahoo-ui/
Does a jquery version excist yet?
I don't think so. Jack Slocum's site is a great source for plugin ideas. The
YUI guys are lucky to have him building off their framework. I say we put a
burlap
... if I merge the arrays
var a = [ 2, 3, 4, 5 ];
var b = [ 1, 1, 2, 3, 5 ];
I get:
[ 2,3,4,5,1,1 ]
So a) the removing all duplicates is not an exact definition
of what this method does or b) there is a bug in `merge` :(
The documentation does not match the comments in the code.
Since the event handling has recently been fixed to avoid IE memory leaks,
could we leverage that? After all, a timer is an event.
$(#time).interval(1000);
basically would map to this:
setInterval(function(){ $(#time).trigger(tick) }, 1000);
An interval of 0 would stop the timer. A one-time
$(document).ready(function(){
$(form .control.date).each( function(i){
var me = $(this)
alert( me.find( '[EMAIL PROTECTED]text]').val() );
alert( me.find( '[EMAIL PROTECTED]hidden]').val() );
alert( me.find(
This is all well and good but the document does not make
this at all clear. I would not have fallen into this trap if
it was documented well.
Point taken, Adam. The documentation could certainly use improvement on that
point.
I also would never have expected that calling a find method on
on
I'm sure most everyone knows by now that IE 7 has been officially
released but I just wanted to ensure that everyone knows that last
night, MS began pushing out IE 7 via Windows Update.
Whoa, are you sure about that? Microsoft said just yesterday that it
wouldn't happen until November:
I am trying to figure out how jQuery works internally. There is a
stack maintained within jQuery but why does jQuery change the 'this'
array of objects? why not just pass back the modified array when
using things like find?
The stack allows to revert to older states. Check the
I finally got around to setting up a build environment here. With revision
453 I am seeing errors in $.find (sibling axis tests) and several of the
ajax functions. Ideas?
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
(An earlier copy of this is stuck in the moderator queue and can be deleted;
there's more detail in this version.)
I've noticed several minor differences with the .text() method across
browsers. For example, given this (note the space around two):
div id=test
div one/div
div two /div
/div
Are you running this on a local machine? I had a similar problem too
until I realized that the test suite refers to PHP files and such that
can only be run on a web server. That's something that needs to be
kept in mind when running them.
Okay, that's good to know. I did check the
John is always in to leave some undocumented stuff
in the code. I took a look at trigger and noticed a
second parameter. Actually, something like this could
be possible:
$('a.remote')
.bind('history', function(event, data) {
// data == click event
})
Mike's approach can be expanded to a complex ajax application. Closures and
element properties are natural ways to associate instance data with elements
in jQuery.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kolman NĂ¡ndor
Sent: Tuesday, October 24,
How about something like this?
jQuery.fn.selectOption = function(v) {
return jQuery.each(function(){
for ( var i=0; i this.options.length; i++ )
if ( this.options[i].value == v ) {
this.selectedIndex = i;
return;
}
};
};
Can I force the click event to fire manually?
To trigger an event you can use...wait for it...trigger(). :-)
$(foo).trigger(click);
Or you can call click with no arguments:
$(foo).click();
As with a real click, the this will be pointing to the element. I'm not
sure about the details of the
It was dying on the if... I removed the check !arg.nodeType for
testing and it worked (commenting out the other stuff)
We need to look into this more. I bet passing a nodeList with
these text nodes would probably still result in Safari crashing.
The quick-fix is there but I think it might
Here is my little plugin to create dom element:
http://204.13.69.149/~wang/
My questions are:
1, Has anybody done this before?
2, As it's my first crack on jQuery, anything wrong with the api call?
3, Is there any more elegant solutions?
As Klaus said, the name is a bit off but I do
2) I'm getting about a 1.5 second pause when the
page loads up, even when on my local system, which
appears to be when my jquery commands execute.
It's just a little too long, my client noticed right away.
Are there any tricks to help this out? For example is
it better to use xpath or css
trying to duplicate specific div that has id=someID and within
that div#someID there is an event attached which is not being
copied across.
When you clone the div, do you change the cloned ID before inserting so it
won't create a duplicate ID?
The W3C doesn't whether cloneNode is supposed to
I'd really like to see John's modifications to pushStack
included in the jQuery core. Details here:
http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html
I'm actually wondering if that modification would break any
existing code, as end() works like before. I guess the only
Is there any supported jQuery platform or situation where
context.getElementsByTagName('*') does not get all the elements in the
context? Right now the jQuery selector code avoids using it and instead does
a recursive crawl of the tree, which has to be a lot more expensive. I know
it wasn't there
I am pretty sure I don't have any code that would be broken by the new
behavior. The entire test suite passes with it, although that may be
more an indictment of the test suite than a stamp of approval. :-)
I'm sure we can write some test that will break when changing
the destructive
I might be wrong, but isn't that what Canvas is for? Drawing shapes?
Canvas is Mozilla's implementation... IE doesn't support that however.
A JQ drawing lib would be great but quite a pain in the ass to code
so it was cross browser.
What else is new? ;-)
None of those pretty dojo examples
Hmmm, I just checked all these links in IE 6.0.2800.1106
and they all work fine for me. So I'm wondering what
version you are using? And why it works for me and not you?
I've got the latest IE6 for XP SP2, which is 6.0.2900.2180. This page gives
me one of those typically unhelpful IE errors:
look at http://imaptools.com:8081/maps/demo.html
and double click on the map, then click the toggle button under the map.
This is currently broken on IE, because of
http://jquery.com/dev/bugs/bug/164/
(Which I hope gets FIXED soon, please!)
I think this is breaking a find() case in
! These are pretty!
Dave Methvin wrote:
Hmmm, I just checked all these links in IE 6.0.2800.1106 and they all
work fine for me. So I'm wondering what version you are using? And
why it works for me and not you?
I've got the latest IE6 for XP SP2, which is 6.0.2900.2180. This page
gives me one
Just use the hover function, there is no plugin needed.
$(td).hover(function(){
$(this).addClass(over);
},function(){
$(this).addClass(out);
});
No, unfortunately it's not that easy if you want to
highlight a complete column...
It's almost that easy. You can put a colgroup in the
but 'break;' won't stop the iteration of each, what should i do?
Return false inside the function and it will stop. That was added recently
but the docs weren't updated to reflect it.
___
jQuery mailing list
discuss@jquery.com
with
IE6 (surprise, surprise). I may need to call in the big guns (aka, Dave
Methvin).
I can see the problem...when the height is explicitly set there is a phantom
area between the official padding and the bottom of the div. Maybe the
quickest fix is to manually change the bottom padding to make
Then, style div.accordion_init to be hidden, and you get the same
effect without misusing the code tag.
Poor people that have to use a text browser, a screenreader,
or simply have switched of CSS...
...
Here's another solution that may be suitable for you: Do not put
all options into the
The recent discussion about the merits of putting code into hidden parts
of the document brings up the accessibility issue. Accessibility is not just
about totally blind or deaf people. It's also about the person who is
color-blind, has limited motor skills, or just prefers using a keyboard.
There are tons of scripts out there for this type of functionality.
Flash can talk to JavaScript and vice versa quite well nowadays,
so getting a flash object (such as a compass) to follow your
mouse via JS updating the flash object isn't hard, but. why?
Client pay to designer lot of
On 10/31/06, Pascal
[EMAIL PROTECTED]
wrote:
I'm trying to do some jQuery manipulations on a form. A reference
tothe form is in the variable 'theForm'. the following generates
anerror in Safari:alert( $(theForm.elements) );the error
generated is: Value undefined (result of
1 - 100 of 285 matches
Mail list logo