Is it possible to change direction of $("selector").show('slow')
and hide('slow')
effects in jQuery?
I can define directions for other effects such as slide and clip, but there's no option for show or hide('slow')
Is it possible to change direction of $("selector").show('slow')
and hide('slow')
effects in jQuery?
I can define directions for other effects such as slide and clip, but there's no option for show or hide('slow')
show()
is just an arbitrary function to display an element on a page. Without the argument it wouldn't even have an animation. If you want access to more elaborate animations and control the direction it fades in on you will need to use .animate()
Or use an extra library that extends jQuery's native functions like jQuery UI
show()
on itself doesn't have any extra effects though..
I can't respond directly to the comments on Norman Joyner's post (not enough rep), but I think you are confused about what 'slow' is. Slow is not an effect like 'slide.' 'Slow' is the speed of the effect. So you should be able to specify
$(this).hide("slide", {direction: "right" }, "slow");
You can't put a direction directly on "slow."
EDIT: Oh, I think I know what you are asking. The default effect on "hide" appears to be "blind." According to this - http://docs.jquery.com/UI/Effects/Blind - the only directions you can specify on blind are horizontal and vertical. Horizontal goes from right to left and vertical from bottom to top. If you want the reverse of those, you'll have to use animate().
There are also sliding jquery effects if you simply want vertical direction:
.slideDown() .slideUp()
and .slideToggle()
Their parameters and usage are almost the same of the .show()
effect.
show()
is just an arbitrary function to display an element on a page. Without the argument it wouldn't even have an animation. If you want access to more elaborate animations and control the direction it fades in on you will need to use .animate()
Or use an extra library that extends jQuery's native functions like jQuery UI
show()
on itself doesn't have any extra effects though..
You can perform special effects with the .show()
and hide()
functions using jQuery UI.
Other than that you can use the default .slideUp()
and .slideDown()
or specify a direction for slide in jQuery UI by doing something like:
$(this).hide("slide", { direction: "right" }, 1000);
I hope this helps.
© 2022 - 2024 — McMap. All rights reserved.