In jQuery, how can I make it so a click function can activate a resizable property
Let's say I have a div
that when it's clicked on it adds the .resizable()
function to the d开发者_Go百科iv
, thus being able to be resized. Would anyone have a code example of this? Thanks!!
Hopefully this will do:
jQuery
<script type="text/javascript">
$(document).ready( function() {
$("#clickme").click(function() {
$("#makethisresizable").resizable();
});
});
</script>
CSS
<style type="text/css">
#makethisresizable {
width: 100px;
height: 100px;
background: blue;
color: white;
}
</style>
HTML
<div id="clickme">Click me</div>
<div id="makethisresizable">Make this resizable</div>
精彩评论