Guest User

Untitled

a guest
Aug 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Handling Anchor Tag Events inside Drag UI
  2. if (Math.abs(distance - initialPosition) > 20) {
  3. $('a').mouseup(function (e) { e.preventDefault(); });
  4. }
  5.  
  6. $('#panorama').mousedown(function (e) {
  7. initialPosition = e.pageX - $('#panorama').position().left;
  8. previousPosition = $('#panorama').position().left;
  9. $(document).mousemove(function (e) {
  10. distance = e.pageX - initialPosition;
  11. $('#panorama').css({ 'left': distance });
  12. if (Math.abs(distance - initialPosition) > 20) {
  13. $('a').mouseup(function (e) { e.preventDefault(); });
  14. }
  15. return false;
  16. });
  17. $(document).one('mouseup', function () {
  18. $(document).unbind();
  19. if (snapTo) {
  20. metroUI.intelliIncrement();
  21. }
  22. });
  23. return false;
  24. });
Add Comment
Please, Sign In to add comment