제품 목록 페이지에서 더 많은 제품이 무한 스크롤과 함께로드됩니다. 문제는 새 페이지가로드되고로드 된 페이지의 '제품 축소판 그림'에 대한 클릭 이벤트가 실행되지 않는 경우입니다. 제품의 축소판 이미지를 클릭하면 이미지를 교환해야합니다. 내가 여기 사용했던 회전 목마가 jcarousel입니다.무한 스크롤 로딩 된 페이지에서 coffeescript를 트리거하는 방법
무한 스크롤 미리
감사 : 아래
$(document).ready ->
$("#home-products").infinitescroll
navSelector: "nav.pagination"
nextSelector: "nav.pagination a[rel=next]"
itemSelector: "#home-products #products"
는
$('.product .v-color').on 'click', (e)->
e.preventDefault()
$this = $(@)
$product = $this.closest('.product')
$product.find('.v-color').removeClass('active')
number = $this.data('carousel-number')
$product.find('.carousel').carousel(number)
$this.addClass('active')
changePrice($product, $this.data('price'), $this.data('soldout'),
$this.data('backorderable'))