-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Elements loaded after events are not draggable.
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Title</title>
<meta name="description" content="">
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<main>
<div>Drag me!</div>
</main>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src='touchpunch.js'></script>
<script src='js.js'></script>
</body>
</html>
$( document ).ready(function() {
/**
* orientationchange
*/
$(window).on('orientationchange', function(e){
// is not draggable
$('main').append('<div>Orientationchange Result</div>');
});
$('main > div:eq(0)').click(function(){
// is not draggable
$('main').append('<div>Click Result</div>');
});
/**
* draggable
*/
$('div').draggable({
cursor: 'pointer'
});
});
Metadata
Metadata
Assignees
Labels
No labels