#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Draggable not working


    I am trying to implement the draggable UI

    I have the needed libraries:
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
    <script src="js/jquery.ui.core.js"></script>
    <script src="js/jquery.ui.widget.js"></script>
    <script src="js/jquery.ui.mouse.js"></script>
    <script src="js/jquery.ui.draggable.js"></script>
    <script src="js/jquery.ui.sortable.js"></script>

    And my markup:
    Code:
    $(function() {
    	$(".img-drop").click(function(){ 
    		//create a div on wall
    		$('<div></div>').attr({
        		id: 'frame1'
    		}).appendTo("#wall");
    		draggable('frame1')
    	});
    	
    	
    	
    });
    
    function draggable(div) {
    	$(div).draggable({ containment: "#wall" });
    }
    The div is created, but it is not draggable.
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,921
    Rep Power
    1045
    Hi,

    Shouldn't this rather be
    Code:
    draggable('#frame1');
    with a "#" and a semicolon?
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0
    Yes, thanks Jacques1. That was it... i looked and looked

IMN logo majestic logo threadwatch logo seochat tools logo