简体   繁体   English

液体滑块(链接到滚动末尾的另一个页面,而不是滚动回到第一个选项卡?)

[英]Liquid Slider (Link to another page at end of scroll, rather than scroll back to first tab?) jQuery

jQuery / Javascript / PHP jQuery / Javascript / PHP

I am using the Liquid Slider as a pagination mechanism on a website, how I use it is I basically have it smoothly scroll through the pages left-right & vice versa. 我将Liquid Slider用作网站上的分页机制,我的使用方式基本上是使它在左右页面之间平滑滚动,反之亦然。

What I'm trying to accomplish right now is: to have the dynamic arrows link to an external page at the end of the scroll (once it detects it is at its last page/tab), rather than to have it scroll back to where it first began. 我现在要完成的工作是:使动态箭头在滚动的末尾链接到外部页面(一旦它检测到它位于最后一页/选项卡),而不是使其滚动回到原来的位置。它首先开始。

Since such option variety is not originally supported from the author website, I am wondering if anyone from here would have an idea how to accomplish this? 由于最初不支持作者网站提供此类选项,所以我想知道这里的任何人是否有想法实现此目的?

A snippet of my dynamic arrows with their callback functions (functions not included): 我的动态箭头及其回调函数(不包括函数)的摘要:

    $('#slider-id').liquidSlider({
        continuous:false,
        dynamicArrows:true,
        dynamicTabs: false,
        callbackFunction: function(){ drawLines() }
    });

    $('.liquid-nav-right-arrow').click(function(){
        simRefresh(), simRefresh2();
    });

    $('.liquid-nav-left-arrow').click(function(){
        simRefresh(), simRefresh2();
    });

You can set conditionals based on the current panel (tab). 您可以基于当前面板(选项卡)设置条件。

callbackFunction: function () {

var sliderObject = $.data( $('#slider-id)[0], 'liquidSlider');

if ( (sliderObject).currentTab === 4 ) {
  //turn off click event
  //update link
}

Then if you want to reset the events again, you can try sliderObject.registerArrows() , although I haven't tested this out. 然后,如果您想再次重置事件,则可以尝试使用sliderObject.registerArrows() ,尽管我尚未对此进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM