jQuery problem

M

Mark Smith

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>
 
T

Thomas 'PointedEars' Lahn

Mark said:
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
 
G

Gregor Kofler

Mark Smith meinte:
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.)
 
D

David Mark

Mark Smith meinte:



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.
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.
 
M

Matt Kruse

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
 
D

David Mark

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?
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.

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.
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!
 
A

ace

Mark said:
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_A..._animations_set_the_display_style_to_block.3F
 
D

David Mark

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.

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

ace

David said:
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,068
Latest member
MakersCBDIngredients

Latest Threads

Top