jQuery Draggable Problem

Posted by Jimbo on Stack Overflow See other posts from Stack Overflow or by Jimbo
Published on 2010-05-27T09:22:30Z Indexed on 2010/05/27 12:41 UTC
Read the original article Hit count: 152

Filed under:
|
|
|

Im trying to get a div to be movable within the constrains of the browser window, by dragging the titlebar inside the div. My code is as follows:

<div id='container'>
    <h3 class='title' id='titlebar'>My Title</h3>
</div>

<script type='text/javascript'>
    $(document).ready(function(){
        $("#titlebar").draggable({ containment: 'window', scroll: false, helper: $('#container') });
    });
</script>

Something is wrong with this (it wont do anything at all) but I cant see the problem!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery