如何在新实例中传递变量?

时间:2019-06-19 14:28:45

标签: javascript jquery class variables swiper

我有以下变量。我想将cgggowl_slidesPerView传递给Swiper配置。我该怎么办?

var cggowl_jav_info_cont = $scope.find('.cggowl-row').eq(0);
var cgggowl_settings = cggowl_jav_info_cont.data('settings');
var cgggowl_slidesPerView = cgggowl_settings['slidesPerView'];

var mySwiper  = new Swiper('.swiper-container', {
  slidesPerView: cgggowl_slidesPerView,
  spaceBetween: cgggowl_spaceBetween,
});

0 个答案:

没有答案