Response title
This is preview!
Note that the target value of the
height
property is'toggle'
. Since the image was visible before, the animation shrinks the height to 0 to hide it. A second click then reverses this transition:
<div id="clickme"> Click here </div> <img id="book" src="book.png" alt="" width="100" height="123" style="position: relative; left: 10px;" />
To animate the opacity, left offset, and height of the image simultaneously:
$('#clickme').click(function() { $('#book').animate({ opacity: 0.25, left: '+=50', height: 'toggle' }, 5000, function() { // Animation complete. }); });
<select id="x" style="width:200px;"> <option>one</option> <option>two</option> </select> <input type="button" value="Disable" onclick="$('#x').attr('disabled','disabled')"/> <input type="button" value="Enable" onclick="$('#x').removeAttr('disabled')"/>
© 2013 jQuery Foundation
Sponsored by and others.