开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜