1

I am using below code but when try to use in mobile then try to drag with touch then it's not work. So can you please advice me how can i use with mobile touch.

 $(document).on('mouseover','.headerimage',function()
    {
        var y1 = $('#timelineBackground').height();
        var y2 =  $('.headerimage').height();
        $(this).draggable({
        scroll: false,
        axis: "y",
        drag: function(event, ui) {
        if(ui.position.top >= 0)
        {
        ui.position.top = 0;
        }
        else if(ui.position.top <= y1 - y2)
        {
        ui.position.top = y1 - y2;
        }
        },
        stop: function(event, ui)
        {
        }
    });
});

Thanks in advance.

Gaurang Sondagar
  • 814
  • 1
  • 9
  • 23

1 Answers1

1

Touch devices do not support mouseover events. Check this for additional info: Preferred Alternative to OnMouseOver for touch

Edit: There seems to be a library made for this specific purpose http://touchpunch.furf.com/

kelk
  • 36
  • 3