0

I have some jQuery slideDown problems.

The first time I click on my slideDown it doesn't animate, it just goes from hidden to visible. But every subsequent click will animate.

This is the code I'm using:

$('#open').click(function() { 
 $('#hideWrapper').slideDown('fast', function()
   }); 
}); 
$('#close').click(function() {
 $('#hideWrapper').slideUp('fast', function() {
   });
});

I think I should use this code because it cleaner but it wont work at all:

$('#open').click(function() { 
 $('#hideWrapper').slideDown('fast', function()
}); 
$('#close').click(function() {
 $('#hideWrapper').slideUp('fast', function() {
});

both of them works fine in jsfiddle:

  1. jsfiddle1
  2. jsfiddle2

Slides down on first click and all, am I not loading jQuery as I should? onDomReady problem?

Thank you in advance for any help you can provide.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Designon
  • 183
  • 1
  • 1
  • 8
  • I am on chrome and it seems to be behaving fine and on safari as well `:)` – Tats_innit Jul 23 '12 at 11:33
  • Second piece of code has syntax errors - you didn't close function braces in both cases. Can you confirm this is the problem in your source as well? – Nemanja Jul 23 '12 at 11:33
  • i use the first piece of code right now, it just that it doesn't animate on the first click. – Designon Jul 23 '12 at 11:47
  • Both versions have syntax errors in your question but not in the fiddles. Please copy and paste the exact code from your real-world case, both the JS and the relevant html/CSS. By the way, you don't need to supply an empty function as the second parameter to `.slideDown()` and `.slideUp()`, just leave that parameter out entirely: `$('#hideWrapper').slideDown('fast');` – nnnnnn Jul 23 '12 at 12:03
  • Got it to work now... i was using spans instead of div:/ now i know that stuff like that matters :) – Designon Jul 23 '12 at 12:26

1 Answers1

0

Try deleting your ASO files.

ASO files are cached compiled versions of your class files. Although the IDE is a lot better at letting go of old caches when changes are made, sometimes you have to manually delete them. To delete ASO files: Control>Delete ASO Files.

This is also the cause of the "I-am-not-seeing-my-changes-so-let-me-add-a-trace-now-everything-works" bug that was introduced in CS3.

shirin
  • 1