fix bugs
This commit is contained in:
parent
357ec2f703
commit
f321d68801
|
@ -100,8 +100,9 @@ class AdBannersController < ApplicationController
|
|||
>
|
||||
<div style=\"padding-bottom: 56.25%;position: relative;height: 0;\">
|
||||
<iframe height=\"100%\" width=\"100%\"
|
||||
src=\"#{youtube_url}\" title=\"youtube\"
|
||||
style=\"position: absolute;\">
|
||||
src=\"#{youtube_url}?enablejsapi=1\" title=\"youtube\"
|
||||
style=\"position: absolute;\"
|
||||
data-yt-api-binded=\"0\" allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
<div class='w-ad-banner__caption_text'>#{ad_b.title}</div>
|
||||
|
|
|
@ -68,15 +68,21 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
|
|||
}
|
||||
|
||||
function onPlayerStateChange(event){
|
||||
var iframe = $(event.target.getIframe()),
|
||||
var iframe = $(event.target.h),
|
||||
cyclediv = iframe.parents("div.cycle-slideshow");
|
||||
var widget = cyclediv.parents('.ba-banner-widget-youtube')
|
||||
if(event.data == YT.PlayerState.PLAYING || event.data == YT.PlayerState.BUFFERING){
|
||||
cyclediv.cycle("pause");
|
||||
widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay').css('visibility','hidden')
|
||||
}else if(event.data == YT.PlayerState.PAUSED || event.data == YT.PlayerState.ENDED){
|
||||
cyclediv.cycle("resume");
|
||||
widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay').css('visibility','')
|
||||
}
|
||||
}
|
||||
$(document).ready(function(){
|
||||
window.onYouTubePlayerAPIReady = function() {
|
||||
onYouTubeIframeAPIReady();
|
||||
};
|
||||
$('.pause-slide').off('click').click(function(){
|
||||
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause');
|
||||
$(this).addClass('active')
|
||||
|
|
Loading…
Reference in New Issue