如何使用 jquery 对同一元素执行多个操作

发布于 2024-10-14 20:38:14 字数 673 浏览 7 评论 0原文

如何在单个元素上同时包含拖动和调整大小。

<head>
<style type="text/css">
  #header { width: 200px; height: 100px; background: blue; }
</style>
<script>
  $(document).ready(function() {
    $("#header").draggable().resizable();
  });
</script>
</head>
<body style="font-size:100%;font-weight:bold;font-style:times" >

    <div id="header">

      <label> Header <input type="text" value="headerBox" /> </label>
      <input type="button" value="submit" id="headerSubmit" name="submit" />
      <input type="reset" value="reset"/>

    </div>

    </body>
    </html>

how do I include both drag and resize on a single element.

<head>
<style type="text/css">
  #header { width: 200px; height: 100px; background: blue; }
</style>
<script>
  $(document).ready(function() {
    $("#header").draggable().resizable();
  });
</script>
</head>
<body style="font-size:100%;font-weight:bold;font-style:times" >

    <div id="header">

      <label> Header <input type="text" value="headerBox" /> </label>
      <input type="button" value="submit" id="headerSubmit" name="submit" />
      <input type="reset" value="reset"/>

    </div>

    </body>
    </html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怪我闹别瞎闹 2024-10-21 20:38:14

可拖动和可调整大小都支持链接模式,因此您可以在一行中简化代码

$(document).ready(function() {

    $("#header").draggable().resizable();
 });

,请参阅此处的演示... 演示
请参阅本教程以获取更多信息.....可拖动且可调整大小

both draggable and resizable supports chaining mode so you can simplify your code in one line

$(document).ready(function() {

    $("#header").draggable().resizable();
 });

see demo here.... DEMO
refer this tutorial for more information .....Draggable and resizable

你げ笑在眉眼 2024-10-21 20:38:14
$(document).ready(function() {

 $("#header").draggable();
$("#header").resizable();

 }); 

看看是否有效

$(document).ready(function() {

 $("#header").draggable();
$("#header").resizable();

 }); 

see if it works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文