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')
jQuery Effect show() Method The show() method shows the hidden, selected elements. Note: show() works on elements hidden with jQuery methods and display:none in CSS (but not visibility:hidden).
<div id=”visibleContent” style = “visibility:hidden”>the jquery visibility is the effect to show and hide the elements as per user requirement. Step 3: The jquery visibility syntax used on the web page. The (“visibility”, “visible”);attribute place with the selector in the script tag.
The slideDown() Method in jQuery is used to check the visibility of selected elements or to show the hidden elements. It works on two types of hidden elements: Elements hidden using jQuery methods. Elements hidden using display: none in CSS.
The slideUp() is an inbuilt method in jQuery which is used to hide the selected elements. Syntax: $(selector). slideUp(speed); Parameter: It accepts an optional parameter “speed” which specifies the speed of the duration of the effect.
All jQuery effects, including .show(), can be turned off globally by setting jQuery.fx.off = true, which effectively sets the duration to 0. For more information, see jQuery.fx.off.
For more information, see jQuery.fx.off . If .slideDown () is called on an unordered list ( <ul>) and its <li> elements have position (relative, absolute, or fixed), the effect may not work properly in IE6 through at least IE9 unless the <ul> has "layout." To remedy the problem, add the position: relative; and zoom: 1; CSS declarations to the ul .
For more information, see jQuery.fx.off . Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation.
The show () method shows the hidden, selected elements. Note: show () works on elements hidden with jQuery methods and display:none in CSS (but not visibility:hidden). Tip: To hide elements, look at the hide () method. Optional. Specifies the speed of the show effect.
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().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With