简体   繁体   English

超大幻灯片-通过链接转到特定幻灯片

[英]Supersized Slide - go to specific Slide by Link

Hi guys I am using the Superslide slider for fullscreen slider images. 嗨,大家好我正在使用Superslide滑块获取全屏滑块图像。 Now i want to to create a website with nearly no text. 现在,我想创建一个几乎没有文本的网站。 So by using the main mavigation, it just should change the images in the slider, or jump to a specific image in the slider. 因此,通过使用主导航,它仅应更改滑块中的图像,或跳转到滑块中的特定图像。

I have tried to use the api.goTo() call in a js function, but it always get me an error, 我试图在js函数中使用api.goTo()调用,但它总是让我出错,

Cannot GET /linoSlider/showSlideTwo() 无法获取/ linoSlider / showSlideTwo()

and also the posts on the internet didn't help me. 而且互联网上的帖子也没有帮助我。

Any ideas how tu jump to a specific image using the supersized slider? 您知道如何使用超大滑块跳至特定图像吗?

To jump to a specific slide you should use a jquery click action in your menu and the api.goTo() including the image number, you should keep track of the number by yourself. 要跳转到特定的幻灯片,您应该在菜单中使用jquery click操作,并使用api.goTo()包括图像编号,您应该自己跟踪编号。

<a href="#" class="link_class01"><span>Menu Item 1</span></a>
<a href="#" class="link_class02"><span>Menu Item 2</span></a>

$(".link_class01").click(function(){
api.goTo(1);
});
$(".link_class02").click(function(){
api.goTo(2);
});

Try that and see what happens. 试试看,看看会发生什么。

Put this in your main html doc. 将其放在您的主要html文档中。 The links will be url/doc.html?num=2 链接将为url / doc.html?num = 2

function GetURLParameter(sParam)
{
    var sPageURL = window.location.search.substring(1);
    var sURLVariables = sPageURL.split('&');
    for (var i = 0; i < sURLVariables.length; i++) 
    {
        var sParameterName = sURLVariables[i].split('=');
        if (sParameterName[0] == sParam) 
        {
            return sParameterName[1];
        }
    }
    return null;
}



jQuery(function($){
    var slideNum = GetURLParameter("num");
    var num = 1;
    if(slideNum!=null){
        if(num > 0) num = slideNum;
    }
}

This was such a pain in the a** i hope this helps. 真是太痛苦了,我希望这会有所帮助。

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

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