I have a blind function that lowers and raises a div. It works great but I want to make it so that the div will go down all the way except 30px and open all the way. How would I do this?
//* JQuery *//
jQuery.fn.blindToggle = function(speed, easing, callback) {
var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
return this.animate({marginTop: parseInt(this.css('marginTop')) >0 ? 0 : +h }, speed, easing, callback);
};
$(document).ready(function() {
var $box = $('#box')
.wrap('<div id="box-outer"></div>');
$('#blind').click(function() {
$box.blindToggle('slow');
});
});
//* CSS *//
#box {
padding: 10px;
height: 100px;
width: 100px;
background: #e459e9;
}
#box-outer {
overflow: hidden;
height: 120px;
margin: 20px;
}
Thanks!