Home › Forums › JavaScript › show/hide › Reply To: show/hide
May 19, 2016 at 7:34 pm
#241894
Participant
It’s only missing the flashing effect when closing a widget.
That’s kind of a shortcoming in the original functionality, it requires for the shadow element to be put outside of the widget and be positioned with javascript. A css approach is a lot cleaner.
Edit – much had to be altered… but here’s a version that does the animations with jQuery so it’s a lot easier to tweak the effect.
$('.widget-hide').click(function() {
$(this).closest(matter).next(haze).stop().fadeTo(200,0.3).delay(300).fadeTo(50,0);
});
When clicking the close button the shadow first fades to opacity 0.3 in 200ms, waits 300ms then fades out completely in 50ms.
fadeTo(200,0.3).delay(300).fadeTo(50,0)