在javascript中跳跃在顶部的视频fancybox [英] video fancybox jumping on top in javascript
问题描述
你好,
我有这段代码可以在精美的盒子上播放youtube视频:
< pre lang =javascipt> // Fancybox Yooutube popup
jQuery(document).ready (function(){
$( 。fancybox-video) .click(function(){
$ .fancybox({
' padding': 0 ,
' autoScale': false ,
' transitionIn ':' none',
' transitionOut':' none',
' title': this .title,
' width': 640 ,
' height': 385 ,
' href': this .href.replace(< span class =code-keyword> new RegExp( watch \\?v = , i),' v /'),
' type':' swf',
' swf':{
' wmode':' transparent',
' allowfullscreen':' true'
}
});
return false ;
});
});
但我有一个问题:跳到顶部点击视频页面
如何解决?
我使用此代码进行fancybox图像以防止跳到顶部:
帮助者:{
overlay:{
已锁定: false
}
}
但实际上我不知道我应该把它放在这个fancybox代码中。
< blockquote>( 。fancybox-video)。click(function(){
.fancybox({
' padding': 0 ,
' autoScale': false ,
' transitionIn': ' none',
' transitionOut':' none',
' title': this .title,
' width': 640 ,
' height': 385 ,
' href': this .href.replace( new RegExp( watch \\?v =, i),' v /'),
' type':' swf',
' swf':{
' wmode':' transparent',
' allowfullscreen':' true'
}
} );
return false ;
});
});
但我有一个问题:跳到顶部点击视频页面
如何解决?
我使用此代码进行fancybox图像以防止跳到顶部:
帮助者:{
overlay:{
已锁定: false
}
}
但实际上我不知道应该把它放在这个fancybox代码中。
hello,
I had this code to stream youtube video on fancy box :
//Fancybox Yooutube popup
jQuery(document).ready(function () {
$(".fancybox-video").click(function () {
$.fancybox({
'padding': 0,
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'title': this.title,
'width': 640,
'height': 385,
'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type': 'swf',
'swf': {
'wmode': 'transparent',
'allowfullscreen': 'true'
}
});
return false;
});
});
but I had a problem : jumping to the top of the page when click on the video
how can I fix it ?
I was using this code for fancybox images to prevent jump to the top :
helpers: {
overlay: {
locked: false
}
}
but actually I do not know where I should put it in this fancybox code.
(".fancybox-video").click(function () {
.fancybox({ 'padding': 0, 'autoScale': false, 'transitionIn': 'none', 'transitionOut': 'none', 'title': this.title, 'width': 640, 'height': 385, 'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 'type': 'swf', 'swf': { 'wmode': 'transparent', 'allowfullscreen': 'true' } }); return false; }); });
but I had a problem : jumping to the top of the page when click on the video
how can I fix it ?
I was using this code for fancybox images to prevent jump to the top :
helpers: { overlay: { locked: false } }
but actually I do not know where I should put it in this fancybox code.
这篇关于在javascript中跳跃在顶部的视频fancybox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!