view_picture.js 592 B

123456789101112131415161718192021
  1. $(function () {
  2. var ViewPicture = {
  3. $picList: '',
  4. winW: $(window).width(),
  5. winH: $(window).height(),
  6. index: 0,
  7. distance: 10,
  8. events: [ 'touchstart', 'touchmove', 'touchend'],
  9. init: function () {
  10. this.bindEvent( $('.i-i-l-item'), this.events[0] ,function () {
  11. console.log($(this).index());
  12. })
  13. },
  14. bindEvent: function ( d, ev, cb, ld) {
  15. cb && d.on( ev, ld, function (e){
  16. cb.call( this, e);
  17. });
  18. }
  19. };
  20. ViewPicture.init();
  21. });