Javascript 带两个猫头鹰转盘的移动问题(宽度)
我找不到与我的具体问题相关的问题或主题 该问题发生在移动(991px)范围内,仅影响第二个猫头鹰转盘 我尝试删除第一个,第二个开始工作。我也有两个开关,没有结果(最后一个总是“销毁”。(第一个:正确的转盘-第二个:销毁) 下面的代码来自我们的php文件,它为前端生成了代码Javascript 带两个猫头鹰转盘的移动问题(宽度),javascript,mobile,carousel,owl-carousel,Javascript,Mobile,Carousel,Owl Carousel,我找不到与我的具体问题相关的问题或主题 该问题发生在移动(991px)范围内,仅影响第二个猫头鹰转盘 我尝试删除第一个,第二个开始工作。我也有两个开关,没有结果(最后一个总是“销毁”。(第一个:正确的转盘-第二个:销毁) 下面的代码来自我们的php文件,它为前端生成了代码 function videoportal_mainpage_carousel( $category ) { // allowed feeds $categories = [ 'new',
function videoportal_mainpage_carousel( $category ) {
// allowed feeds
$categories = [
'new',
'highlights'
];
if( !in_array( $category, $categories ) ) {
return;
}
$args = [
'post_type' => 'video',
'suppress_filters' => 0
];
switch( $category ) {
case 'highlights':
// extend category with order by likes and filtered by "highlight" enabled
$_args = [
'meta_key' => 'likes',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'meta_query' =>
/**
* Merge the default video filters with the highlight filter
*/
array_merge(
[
[
'key' => 'highlight',
'value' => '1',
'compare' => '='
],
],
videoportal\plugin\Video::getDefaultVideoFilters()
)
];
break;
case 'new':
// only filter out default filters
$_args = [
'meta_query' => videoportal\plugin\Video::getDefaultVideoFilters()
];
break;
}
$args = array_merge( $args, $_args );
$query = new WP_Query( $args );
// loop the videos
if( !$query->have_posts() ) {
return;
}
$html = '<ul class="owl-carousel carousel-fw fw-carousel"
id="%s-carousel"
data-columns="6"
data-autoplay="yes"
data-loop="yes"
data-padding="0"
data-center-align="yes"
data-autoplay-timeout="5000"
data-pagination="no"
data-arrows="yes"
data-items-desktop="2"
data-items-desktop-small="1"
data-items-tablet="1"
data-items-mobile="3">';
$html = sprintf( $html, $category );
while( $query->have_posts() ) {
$query->the_post();
// set video object
$video = new \videoportal\plugin\Video( get_the_ID() );
// get image
$image = $video->getThumbnail();
// get description
$description = $video->getDescription( 'short' );
if( strlen( $description ) > 0 ) {
$description = sprintf(
'<span>%s</span>',
$video->getDescription( 'short' )
);
}else {
$description = '<div class="no-description"></div>';
}
// get list of categories without links as the container itself is already linked
$categories = $video->getCategoryList( false );
// set up item
$item =
'<li class="item match-height">
<!-- start news items -->
<a href="%1$s" title="%2$s" class="news-items">
<!-- start news media -->
<span class="news-media">
<span class="media-box">
<img src="%3$s" alt="%2$s">
<span class="ico-play"><i class="fa fa-play-circle-o"></i></span>
</span>
<span class="news-caption">
<span>%4$s</span>
<strong>%2$s</strong>
</span>
</span>
<!-- end news media -->
<!-- start news content -->
<span class="news-content">
%5$s
</span>
<!-- end news content -->
</a>
<!-- end news items -->
</li>';
$item = sprintf(
$item,
get_permalink(),
get_the_title(),
$image,
$categories,
$description
);
$html .= $item;
}
$html .= '</ul>';
wp_reset_postdata();
return $html;
}
function videoportal\u mainpage\u carousel($category){
//允许的馈送
$categories=[
"新",,
“亮点”
];
if(!in_数组($category,$categories)){
返回;
}
$args=[
“post_type”=>“video”,
“抑制_过滤器”=>0
];
交换机($类别){
案例“亮点”:
//扩展类别,按喜欢排序,并启用“突出显示”筛选
$\参数=[
“meta_key”=>“likes”,
'orderby'=>'meta_value_num',
“订单”=>“描述”,
“元查询”=>
/**
*将默认视频过滤器与高亮显示过滤器合并
*/
数组合并(
[
[
'键'=>'突出显示',
“值”=>“1”,
'比较'=>'='
],
],
videoportal\plugin\Video::getDefaultVideoFilters()
)
];
打破
“新”案例:
//仅过滤掉默认过滤器
$\参数=[
'meta_query'=>videoportal\plugin\Video::getDefaultVideoFilters()
];
打破
}
$args=array\u merge($args,$\u args);
$query=新的WP\u查询($args);
//循环播放视频
如果(!$query->have_posts()){
返回;
}
$html='”;
$html=sprintf($html$category);
而($query->have_posts()){
$query->the_post();
//设置视频对象
$video=new\videoportal\plugin\video(获取\u ID());
//获取图像
$image=$video->getThumbnail();
//获取描述
$description=$video->getDescription('short');
如果(strlen($description)>0){
$description=sprintf(
“%s”,
$video->getDescription('short')
);
}否则{
$description='';
}
//获取没有链接的类别列表,因为容器本身已链接
$categories=$video->getCategorilyList(false);
//设置项
$item=
“-
';
$item=sprintf(
$item,
get_permalink(),
获取标题(),
$image,
$类别,
$description
);
$html.=$item;
}
$html.='
';
wp_reset_postdata();
返回$html;
}
如果需要,我可以提供更多细节。让我知道
提前感谢,,
Sascha这听起来像是版本2.2.1中的已知错误,请尝试最新版本的Owl Carousel v2.3.4
我想这会解决你的问题。
owl!=owl carousel
..@AKSW你是什么意思?你使用了“owl”作为标记。owl
代表Web本体语言,与owl carousel
没有关系。我为你修复了它