mbe.ro
<h2>What is this web-site?</h2> <br/> <start_coding(); //just some tips and tricks for web programmers<br/>echo "Hope this is helpful to you";<br/>?>

jQuery Slide Bug / Fix

November 3, 2009 at 3:12 PM

In IE the jquery slide effect does not work so well. So I tried to make a fix (but using the jquery ui effects). I rewrote the slideUp, slideDown and slideToggle (and all of them work like a charm in all browsers):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$.fn.slideToggle = function (_speed,_function) {
	$(this).toggle('slide',{direction:'up'},_speed,_function);
}
$.fn.slideUp = function (_speed,_function) {
	if (!$(this).is(':hidden')) {
		$(this).hide('slide',{direction:'up'},_speed,_function);
	} else {
		if (_function)
			_function.call();
	}
}
$.fn.slideDown = function (_speed,_function) {
	if ($(this).is(':hidden')) {
		$(this).show('slide',{direction:'up'},_speed,_function);
	} else {
		if (_function)
			_function.call();
	}
}