Click to enlarge button
Description
The following code shows how to click to enlarge button.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.8.3.js'></script>
<link rel="stylesheet" type="text/css"
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/css/bootstrap.min.css">
<script type='text/javascript'>
$(window).load(function(){<!-- w w w. ja va2s.c om-->
$('button').click(function() {
var width = $(this).css('width');
var height = $(this).css('height');
$(this).html('Hello, World!');
var newWidth = $(this).css('width');
$(this).css({'width': width, 'height': height});
$(this).animate({'width': newWidth}, 1000);
});
});
</script>
</head>
<body style='margin:30px'>
<button class='btn'>Hello</button>
</body>
</html>