Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. // ПЪРВА ЧАСТ
  2.  
  3. /* Animate flying tickets */
  4. if (initialize.device[0] === 'iPhone') {
  5. // jQuery .position() doesn't work on IOS devices. This is a hardcore solution which works for now.
  6. leftEnd = $('#game').width() / 12.35;
  7. } else if (navigator.userAgent.indexOf('Mac OS X') != -1) {
  8. // jQuery .position() doesn't work on Mac OS devices. This is a hardcore solution which works for now.
  9. leftEnd = $('#game').width() / 18;
  10. console.log('MAC OS - LEFT END = ' + leftEnd);
  11. }
  12.  
  13.  
  14. // ВТОРА ЧАСТ
  15.  
  16. function topEndByDevice(animationWrapper) {
  17. let topEnd;
  18. if (initialize.device[0] === 'iPhone' || initialize.device[0] === 'ipad' || navigator.userAgent.indexOf('Mac OS X') != -1) {
  19. // jQuery .position() doesn't work on IOS and MAC OS devices. This is a hardcore solution which works for now.
  20. topEnd = $('#game').height() / 4.43;
  21. console.log('MAC OS - TOP END = ' + topEnd);
  22. } else if (initialize.device[0] === 'android') {
  23. topEnd = animationWrapper.position().top + 30;
  24. } else {
  25. topEnd = animationWrapper.position().top + 100;
  26. }
  27. return topEnd;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement