jQuery Cycle 2:加载活动幻灯片的链接值

时间:2017-01-31 06:53:11

标签: jquery wordpress

我正在使用jQuery Cycle 2插件在此页面http://webees.site/zufanek-cz/kronika/的菜单中切换年份。单击选定年份后,它将使用AJAX加载更多解决方案(https://connekthq.com/plugins/ajax-load-more/)加载WordPress帖子的新查询。我想自动执行此操作。设置一些计时器(比如1秒)并在此之后自动激活链接。

但是我不知道如何做到这一点,jQuery Cycle 2有一个循环后事件,但是我无法使用计时器。

<span class="switch restore">
    <a href="#" class="restore" data-posts-per-page="4" data-year="" data-month="" data-pause="false" data-pause-override="false" data-preloaded="false">obnovit</a> <!-- this is used to restore a default query -->
</span>
<div class="carousel">
    <a href="#" class="prev">Předchozí</a> <!-- shows previous year -->
    <a href="#" class="next">Další</a> <!-- shows next year -->
    <ul class="nav-years cycle-slideshow" data-cycle-fx="carousel" data-cycle-slides='> li.year' data-cycle-timeout="0" data-cycle-prev=".prev" data-cycle-next=".next" data-cycle-carousel-visible="1" data-allow-wrap="false" data-cycle-carousel-vertical="true"><!-- initializes slideshow -->
        <li class="year year-1" id="year-1"><span class="switch"><a href="#" data-year="2016" data-posts-per-page="1000" data-month="" data-pause="false" data-pause-override="false" data-preloaded="false">2016</span></a></li> <!-- one particular year with a new query, this should be loaded automatically second after being displayed --> 
        <li class="year year-2" id="year-2"><span class="switch"><a href="#" data-year="2015" data-posts-per-page="1000" data-month="" data-pause="false" data-pause-override="false" data-preloaded="false">2015</span></a></li>
        <li class="year year-3" id="year-3"><span class="switch"><a href="#" data-year="2014" data-posts-per-page="1000" data-month="" data-pause="false" data-pause-override="false" data-preloaded="false">2014</span></a></li>
    </ul>
</div>

0 个答案:

没有答案