syntax for .show/hide with animate set to false
syntax for .show/hide with animate set to false
I am not finding examples of setting the animate to false for .show and .hide and I can't figure out the correct syntax
I am needing it for show/add of all fields: .show()
and also an array of fields: .show(['field1','field2'])
This question has an accepted answers - jump to answer
Answers
For
show()
, it's an additional parameter, so something likeIs that not working for you?
Colin
no, it doesn't seem to be working. I don't get any errors in the console, but it just doesn't display the fields. If i take out the ', false' then it works just fine, but with the animate of course.
Unfortunately, I cant provide a link to the project since it is on our intranet.
It seems to be working as expected here - if you remove the
false
, you'll see the animation. There is a slight jerk still, if you want that entirely removed, uncomment the$.fx.off = true;
line at the top, and that stops all animations at the jQuery level.Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example so that we can see the problem.
Cheers,
Colin
So there are two issues I am seeing.
1). I don't see a way to add false if you are hiding/showing all fields .hide()
2). I am wanting to hide all, then show a few. It works fine if I leave off animation, but if you hide all, then try to show with animation set to false, the fields don't show:
http://live.datatables.net/venireju/3/edit
.hide()
.show('field',false)
Ah, I see, if you pass in
undefined
for the fields, then that works, something likeI've updated the example with that. There is still some twitching with
opened
, so I moved it intopreOpen
so the hides happen before the form is visible,colin
Awesome. I tried using an empty array and it didn't like that.
And after changing the 'hide all' to undefined,false, it fixed the issue with .show not working.
All appears to work great now. thanks