开发者

In jQuery, how can I make it so a click function can activate a resizable property

开发者 https://www.devze.com 2023-01-06 03:36 出处:网络
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 t

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

精彩评论

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