Unknown reason drag not working


#1

Not working for ionic view for iphone… is there any update? here’s my code, what went wrong?

link:function(scope,element,attr){
var startX=0,startY=0
var endX = 0, endY = 0
var x=10,y=10

element.css({
// ‘position’: ‘relative’,
‘position’: ‘absolute’,
‘border-color’: ‘blue’,
‘border-style’: ‘solid’,
‘border-top-width’: ‘100px’,
‘border-right-width’: ‘2px’,
‘border-bottom-width’: ‘100px’,
‘border-left-width’: ‘2px’,
‘cursor’: ‘pointer’,
‘z-index’: ‘100’
});

var dragGes = $ionicGesture.on(‘drag’,dragFn,element)
function dragFn(event){
event.preventDefault()
endX = event.gesture.center.pageX - x
console.log(endX)
element.css({
left: endX + ‘px’
})
}