jQuery toggle opacity with animate function
<p>i wrote a jquery function and from there i try to toggle opacity with animate function but my code is not working. can anyone tell me where is the fault. thanks</p>

<pre><code>            jQuery.fn.blindToggle = function (speed, easing, callback) {
            var _opacity = 0;
            var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
            $(this).toggle(function () {
                _opacity = 0;
            },
            function () {

                _opacity = 1;
            });
            alert(_opacity);
            return this.animate({ opacity: _opacity,
                marginTop: parseInt(this.css('marginTop')) &lt; 0 ? 0 : -h
            }, speed, easing, callback);
        };
</code></pre>
