mawiegand / homepage

My personal site. Feel free to report bugs or feature requests! Contributions and forks are also welcome! :-)
https://wiegand.dev
0 stars 0 forks source link

Fix Slider layout #23

Closed mawiegand closed 7 years ago

mawiegand commented 8 years ago

Fix Slider mobile layout. Remove side controls and enable swipe.

mawiegand commented 7 years ago

To enable swiping add jQuery Mobile and insert the following code in home.coffee

$('.carousel').swipe
  swipe: (event, direction, distance, duration, fingerCount, fingerData) ->
    if direction == 'left'
      $(this).carousel 'next'
    if direction == 'right'
      $(this).carousel 'prev'
    return
  allowPageScroll: 'vertical'
mawiegand commented 7 years ago

Code improvement:

$ ->
  $('.carousel').swipeleft ->
    $(this).carousel 'next'
  $('.carousel').swiperight ->
    $(this).carousel 'prev'`