问题描述
我的滑块很长,需要用鼠标滚动,我将此箭头设置为固定在屏幕中央。
当我点击导航箭头转到下一张幻灯片时,下一张幻灯片没有完全向上滚动的问题。
我已经激活了“自动高度”,如果我直接取消自动高度,它不会向上滚动。
我在wordpress的functions.PHP中创建了这个函数
function salta_hacia_arriba(){ ?>
<script>
jQuery(document).ready(function($) {
/* custom arrows */
$( ".owl-prev").html('<i id="link" class="fa fa-chevron-left"></i>');
$( ".owl-next").html('<i id="link" class="fa fa-chevron-right"></i>');
/* Funcion scroll to anchor */
function scrollToAnchor(aid){
var aTag = $("section[id='"+ aid +"']");
$('html,body').animate({scrollTop: aTag.offset().top},'slow');
}
/* function scroll call */
$("#link").click(function() {
scrollToAnchor('arriba'); //arriba is section at the top of the page ID
});
});
</script>
<?PHP }
add_action('wp_head','salta_hacia_arriba');
这是箭头 html
<div class="owl-nav">
<button type="button" role="presentation" class="owl-prev">
<i id="link" class="fa fa-chevron-left"></i>
</button>
<button type="button" role="presentation" class="owl-next">
<i id="link" class="fa fa-chevron-right">
</i>
</button>
</div>
左箭头运行完美,但右箭头不能完全滚动到页面顶部。
怎么了?
谢谢!!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)