how to make the red div don't alert 'ss' when drag the black div on it ,

Posted by zjm1126 on Stack Overflow See other posts from Stack Overflow or by zjm1126
Published on 2010-03-13T07:55:22Z Indexed on 2010/03/13 8:05 UTC
Read the original article Hit count: 305

Filed under:
|
|

i using jquery and jquery-ui,

this is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
    <head> 
        <meta name="viewport" content="width=device-width, user-scalable=no"> 
</head> 
    <body>
        <style type="text/css" media="screen"> 

        </style>

        <div id=a style="width:300px;height:300px;background:blue;position:absolute;"></div>
        <div id=b style="width:100px;height:100px;background:red;position:absolute;"></div>
        <div id=c style="width:50px;height:50px;background:black;clear:both"></div>
        <script src="jquery-1.4.2.js" type="text/javascript"></script>
        <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script>
        <script type="text/javascript" charset="utf-8"> 
$("#c").draggable({});
$("#b").droppable('disable');//this is not useful

$("#a").droppable({
drop: function(event,ui) {
    alert('ss')
    }
});
        </script> 

    </body> 
</html>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui