最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JQuery UI draggable not working at all! - Stack Overflow

programmeradmin0浏览0评论

Why does this not work at all for me?

<script type="text/javascript" src="Javascript/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="Javascript/jquery-1.3.2.min.js"></script>     
<script type="text/javascript">

    $(function() {
    $('.selector').draggable({ axis: 'x' });    });

    </script>

    <body>

    <div class="selector">
        <p>Drag me around</p>
    </div>

I have literally just copied and pasted from the draggable example page on the jQuery site and it just doesn't work :(

Can anyone tell me why?

Why does this not work at all for me?

<script type="text/javascript" src="Javascript/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="Javascript/jquery-1.3.2.min.js"></script>     
<script type="text/javascript">

    $(function() {
    $('.selector').draggable({ axis: 'x' });    });

    </script>

    <body>

    <div class="selector">
        <p>Drag me around</p>
    </div>

I have literally just copied and pasted from the draggable example page on the jQuery site and it just doesn't work :(

Can anyone tell me why?

Share Improve this question asked Dec 3, 2009 at 17:46 Sam GregorySam Gregory 1392 silver badges13 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 15

Change the order of the javascript includes, the jQuery core file always comes first.

May sound trivial but you need to load the jQuery library before jQuery UI:

<script type="text/javascript" src="Javascript/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="Javascript/jquery-ui-1.7.2.custom.min.js"></script>     
<script type="text/javascript">
  $(function() {
    $('.selector').draggable({ axis: 'x' });
  });
</script>
<body>
  <div class="selector">
    <p>Drag me around</p>
  </div>
发布评论

评论列表(0)

  1. 暂无评论