0
draggable jquery UI 플러그인 (http://jqueryui.com/demos/draggable/)을 사용하여 내 페이지에 드래그 가능한 요소를 추가하려고합니다. 내가 필요로 무엇jquery animate vertical up
$("#makeMeDraggable").draggable({ axis: "y", limit: {top: 10, bottom: 550}});
수직으로 드래그 할 수 있도록 단지입니다 -하지만 위쪽 (아래쪽으로 드래그 불허) :
$("#makeMeDraggable").draggable({ axis: "y"});
이미 시도 : 순간 나는이 있습니다. 작업 예제
$("#makeMeDraggable").draggable({ axis: "y"});
var lastYPosition = null;
$("#makeMeDraggable").draggable({
drag: function(event, ui) {
// set with the initial y position
if(lastYPosition === null) {
lastYPosition = ui.originalPosition.top;
}
// don't do the drag if the new y position is larger than the old one
if(ui.position.top > lastYPosition) {
return false;
}
// update the last y position with current value
// so we can check against it next time
lastYPosition = ui.position.top;
}
});
그리고 여기에 있습니다 : : (크롬과 사파리에서 테스트)를 당신이 여기서 뭘하려고 무엇
http://jsfiddle.net/jameszaghini/s4vfX/ – Bojangles
제임스가 게시 한 효과를 JamWaffles가 시도했습니다. 즉, "수직 위로"끌기 만 허용했습니다. – Snapper