Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript show/hide Reply To: show/hide

#241894
Shikkediel
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.

Link

$('.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)