Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

jQuery problem

8 views
Skip to first unread message

Mark Smith

unread,
Jun 5, 2009, 6:53:30 AM6/5/09
to
Is this a bug in jQuery or am I doing something wrong?

I am trying to chain together a bunch of drop down select boxes.

Whenever I just use .hide() and .show() it works fine. But if I
use .show("slow") it adds big gaps between some of the select boxes.

I get the same result with both FF, IE and Safari.

Example code is below. Any ideas?

Thanks


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></
script>
</head>
<body>
<form action="" onsubmit="return false;">
<input type="text" id="test" value="" style="width: 200px;" /><br/>
<select name="sel" id="sel">
<option>1</option>
<option>2</option>
<option>3</option>
</select><br/>
<select name="sel1" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
</select><br/>
<select name="sel2" id="sel2">
<option>1</option>
<option>2</option>
<option>3</option>
</select><br/>
<select name="sel3" id="sel3">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</form>
<script type="text/javascript">
$('#sel1').hide();
$('#sel2').hide();
$('#sel3').hide();
//$("#sel").ajaxAddOption("http://localhost:83/ajax/random", null,
false);
$("#sel").change(function(event)
{
//$("#sel1").ajaxAddOption("http://localhost:83/ajax/random", null,
false);
$('#sel1').show("slow");
$('#sel2').hide();
$('#sel3').hide();
});
$("#sel1").change(function(event)
{
//$("#sel2").ajaxAddOption("http://localhost:83/ajax/random", null,
false);
$('#sel2').show("slow");
$('#sel3').hide();

});
$("#sel2").change(function(event)
{
//$("#sel3").ajaxAddOption("http://localhost:83/ajax/random", null,
false);
$('#sel3').show("slow");
});

</script>
</body>
</html>


rf

unread,
Jun 5, 2009, 7:34:19 AM6/5/09
to
Mark Smith wrote:
> Is this a bug in jQuery or am I doing something wrong?

Who cares?


Thomas 'PointedEars' Lahn

unread,
Jun 5, 2009, 7:54:37 AM6/5/09
to
Mark Smith wrote:
> Is this a bug in jQuery

Probably.

> or am I doing something wrong?

Definitely, you are using jQuery.

> I am trying to chain together a bunch of drop down select boxes.
>
> Whenever I just use .hide() and .show() it works fine. But if I
> use .show("slow") it adds big gaps between some of the select boxes.
>
> I get the same result with both FF, IE and Safari.
>
> Example code is below. Any ideas?

<http://groups.google.com/groups?as_q=jQuery&as_ugroup=comp.lang.javascript&scoring=d&filter=0>
<http://jibbering.com/faq/#onlineResources>


PointedEars

Mark Smith

unread,
Jun 5, 2009, 8:34:19 AM6/5/09
to
On Jun 5, 12:54 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:

> Mark Smith wrote:
> > Is this a bug in jQuery
>
> Probably.
>
> > or am I doing something wrong?
>
> Definitely, you are using jQuery.
>

Ouch! I had heard good things about jQuery.

What javascript framework(s) would you recommend?

Gregor Kofler

unread,
Jun 5, 2009, 8:58:19 AM6/5/09
to
Mark Smith meinte:

> On Jun 5, 12:54 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
> wrote:
>> Mark Smith wrote:
>>> Is this a bug in jQuery
>> Probably.
>>
>>> or am I doing something wrong?
>> Definitely, you are using jQuery.
>>
>
> Ouch! I had heard good things about jQuery.

Naturally. Since most jQuery fanbois have never done any native JS, and
think jQuery is sheer magic.

> What javascript framework(s) would you recommend?

Your own? All those general purpose libraries share most of the same
flaws: bloated, slow, "odd" API, browser sniffing. They are full of
solutions for non-existent problems, and they keep people from
understanding how JS works.

Gregor

(David Mark - until recently staunchly condemning general purpose JS
libraries - might recommend not the current, but the yet-to-be-seen
version of Dojo.)

--
http://www.gregorkofler.com
http://web.gregorkofler.com - vxJS, a JS lib in progress

David Mark

unread,
Jun 5, 2009, 2:49:14 PM6/5/09
to
On Jun 5, 8:58 am, Gregor Kofler <use...@gregorkofler.com> wrote:
> Mark Smith meinte:
>
> > On Jun 5, 12:54 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
> > wrote:
> >> Mark Smith wrote:
> >>> Is this a bug in jQuery
> >> Probably.
>
> >>> or am I doing something wrong?
> >> Definitely, you are using jQuery.
>
> > Ouch! I had heard good things about jQuery.
>
> Naturally. Since most jQuery fanbois have never done any native JS, and
> think jQuery is sheer magic.

Right. And the minority who have are content to be the bigger fish in
a very small pond. In other words, washouts. That's bad enough, but
when I tell them to fix something simple and they don't (e.g. Matt
Kruse, John Resig, Ricardo, etc.), it means they either don't
understand basic issues (e.g. the attr method) or are irretrievably
lazy. Nor do I find it honest for such people to recommend a script
when they know it is crawling with bugs. I don't want to interact
with a "team" like that. So they are left to copy what they can.

>
> > What javascript framework(s) would you recommend?
>
> Your own? All those general purpose libraries share most of the same
> flaws: bloated, slow, "odd" API, browser sniffing. They are full of
> solutions for non-existent problems, and they keep people from
> understanding how JS works.

Absolutely.

>
> Gregor
>
> (David Mark - until recently staunchly condemning general purpose JS
> libraries - might recommend not the current, but the yet-to-be-seen
> version of Dojo.)

Dojo is not a library per se. And I haven't changed my mind a bit
about browser scripting. You won't hear me recommend any library,
framework, toolkit or whatever to neophytes. It's just that some
developers refuse to do without them and I have decided that Dojo is
the one that deserves my support and assistance.

Matt Kruse

unread,
Jun 5, 2009, 4:16:42 PM6/5/09
to
On Jun 5, 1:49 pm, David Mark <dmark.cins...@gmail.com> wrote:
> when I tell them to fix something simple and they don't (e.g. Matt
> Kruse, John Resig, Ricardo, etc.), it means they either don't
> understand basic issues (e.g. the attr method) or are irretrievably
> lazy.  

You seem to be infatuated with me lately. Very flattering. ;)
(ps - I am not a jQuery contributor)

> Nor do I find it honest for such people to recommend a script
> when they know it is crawling with bugs.

I recommend flawed software all the time. Because the alternative is
_no_ software.

> Dojo is not a library per se.

lol

In this instance, "per se" means "it is, but I don't feel comfortable
thinking of it that way because this is a total reversal of everything
I've been saying for years"

> It's just that some
> developers refuse to do without them and I have decided that Dojo is
> the one that deserves my support and assistance.

Wow, how lucky of them. They now have a Supreme Douche writing code
for them and evangelizing their library! Perhaps it isn't that they
are the only ones that deserve your assistance, but rather they are
the only ones desperate enough to put up with your general
douchebagedness? It's like charities that refuse donations from
hateful organizations because they don't want to be associated with
them. Most people would want to keep their distance from you.

Hopefully the end result is something useful (I'll gladly switch to a
different library if it works better), but I'll bet all the apples in
my basket that that does not happen.

Have a great day!

Matt Kruse

David Mark

unread,
Jun 5, 2009, 4:41:51 PM6/5/09
to
On Jun 5, 4:16 pm, Matt Kruse <m...@thekrusefamily.com> wrote:
> On Jun 5, 1:49 pm, David Mark <dmark.cins...@gmail.com> wrote:
>
> > when I tell them to fix something simple and they don't (e.g. Matt
> > Kruse, John Resig, Ricardo, etc.), it means they either don't
> > understand basic issues (e.g. the attr method) or are irretrievably
> > lazy.  
>
> You seem to be infatuated with me lately. Very flattering. ;)
> (ps - I am not a jQuery contributor)

Interesting spin. You are the poster boy for this sort of futility.
You spent years begging me to fix jQuery (in a rather impolite and
irritating manner), asking about this and that, but then you didn't
bother to convert any of my answers into fixes. What was all that
about?

>
> > Nor do I find it honest for such people to recommend a script
> > when they know it is crawling with bugs.
>
> I recommend flawed software all the time. Because the alternative is
> _no_ software.

You keep topping yourself. That might be the stupidest thing you've
said yet.

>
> > Dojo is not a library per se.
>
> lol

What's funny about that? You think jQuery and Dojo are comparable in
some way?

>
> In this instance, "per se" means "it is, but I don't feel comfortable
> thinking of it that way because this is a total reversal of everything
> I've been saying for years"

No, stupid. I've reversed nothing. My opinion of general-purpose
libraries, toolkits or whatever is exactly the same. If you would
read (for a change), you would know that. See if you can figure out
what *has* changed and how that might affect my view of the current
landscape.

>
> > It's just that some
> > developers refuse to do without them and I have decided that Dojo is
> > the one that deserves my support and assistance.
>
> Wow, how lucky of them.

Or rather, how unlucky and clumsy of you. Could have gone another
way.

> They now have a Supreme Douche writing code

LOL. I bet you are in a state other than Ohio, right? Just a hunch.

> for them and evangelizing their library! Perhaps it isn't that they

Do you hear me out there (or in here) telling anyone to use any
library for anything? If so, you are hallucinating.

> are the only ones that deserve your assistance, but rather they are
> the only ones desperate enough to put up with your general
> douchebagedness?

Again, I don't think that's something you would say within 100 miles
of me.

> It's like charities that refuse donations from
> hateful organizations because they don't want to be associated with
> them. Most people would want to keep their distance from you.

Except the ones I make rich. ;)

>
> Hopefully the end result is something useful (I'll gladly switch to a
> different library if it works better), but I'll bet all the apples in
> my basket that that does not happen.

That what doesn't happen?

>
> Have a great day!
>

Already am! Thanks!

ace

unread,
Jun 6, 2009, 4:14:37 AM6/6/09
to
Mark Smith wrote:
> Is this a bug in jQuery or am I doing something wrong?
>
> I am trying to chain together a bunch of drop down select boxes.
>
> Whenever I just use .hide() and .show() it works fine. But if I
> use .show("slow") it adds big gaps between some of the select boxes.
>
> I get the same result with both FF, IE and Safari.
>
> Example code is below. Any ideas?

dropdowns get a block style after animation and so you get the gaps,

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_animations_set_the_display_style_to_block.3F

David Mark

unread,
Jun 6, 2009, 2:05:00 PM6/6/09
to
On Jun 6, 4:14 am, ace <n...@nn.com> wrote:
> Mark Smith wrote:
> > Is this a bug in jQuery or am I doing something wrong?
>
> > I am trying to chain together a bunch of drop down select boxes.
>
> > Whenever I just use .hide() and .show() it works fine. But if I
> > use .show("slow") it adds big gaps between some of the select boxes.
>
> > I get the same result with both FF, IE and Safari.
>
> > Example code is below. Any ideas?
>
> dropdowns get a block style after animation and so you get the gaps,

Dog ate your shift key? And what is jQuery's problem with animating
SELECT's? Never mind, I think I remember that code. There's a gap
alright (in the authors' understanding.)

So, why do you use this crap again? There's more land mines than with
standard DOM scripting.

>
> http://docs.jquery.com/Frequently_Asked_Questions#Why_do_animations_s...

Yeah, right. The wonderful docs. Wrong as usual. The rules haven't
changed for years. You don't need this "new wave" interpretation.

ace

unread,
Jun 6, 2009, 2:55:55 PM6/6/09
to
David Mark wrote:
>>> I get the same result with both FF, IE and Safari.
>>> Example code is below. Any ideas?
>> dropdowns get a block style after animation and so you get the gaps,
>
> Dog ate your shift key?

yes, how did you guess?

>And what is jQuery's problem with animating
> SELECT's? Never mind, I think I remember that code. There's a gap
> alright (in the authors' understanding.)

who are you talking to?

<snip monologue>

0 new messages