Fix js bug.

This commit is contained in:
BoHung Chiu 2022-06-14 10:41:44 +08:00
parent bf6234cdbc
commit dd11045c03
2 changed files with 8 additions and 8 deletions

View File

@ -40,21 +40,21 @@
</div>
<script>
var flag = 1;
$('.pause-slide').off('click').click(function(){
$('[data-subpart-id="{{subpart-id}}"] .pause-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause');
$(this).addClass('active')
$(this).parents('.controlplay').eq(0).find('.resume-slide').removeClass('active')
});
$('.resume-slide').off('click').click(function(){
$('[data-subpart-id="{{subpart-id}}"] .resume-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('resume');
$(this).addClass('active')
$(this).parents('.controlplay').eq(0).find('.pause-slide').removeClass('active')
});
$('.next-button').off('click').on('click',function(){
$('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next");
})
$('.prev-button').off('click').on('click',function(){
$('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev");
})

View File

@ -277,20 +277,20 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
banner_wrap.height(height)*/
banner_wrap.css("padding-bottom","");
{{extra_document_ready_script}}
$('.pause-slide').off('click').click(function(){
$('[data-subpart-id="{{subpart-id}}"] .pause-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause');
$(this).addClass('active');
$(this).parents('.controlplay').eq(0).find('.resume-slide').removeClass('active');
});
$('.resume-slide').off('click').click(function(){
$('[data-subpart-id="{{subpart-id}}"] .resume-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('resume');
$(this).addClass('active');
$(this).parents('.controlplay').eq(0).find('.pause-slide').removeClass('active');
});
$('.next-button').off('click').on('click',function(){
$('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next");
})
$('.prev-button').off('click').on('click',function(){
$('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev");
})
var resize_timeout_id;