erik-krogh / SudoSlider

The most versatile jQuery content slider
36 stars 24 forks source link

Link inside a slide #51

Closed plnghzz closed 8 years ago

plnghzz commented 8 years ago

Hi,

I am using SudoSlider and instead of an image, I want a custom content. So I did this :

<div class="home-slider">
    <div id="home-slider-menu">
        <ul> {foreach $slides AS $k => $slide}
            <li data-target="{$k+1}" class="custom"><a href="javascript:void(0);">{$slide.btn_name}</a></li> {/foreach} </ul>
    </div>
    <div id="home-slider-content">
        <ul> {foreach $slides AS $k => $slide}
            <li data-slide="{$k}">
                <div style="background:url('{$slide.image}');" class="slide-overlay{if !$slide.text} no-content{/if}">
                    <div class="overlay"> {if $slide.text}
                        <div class="text">
                            <h2>{$slide.public_name}</h2>{$slide.text}</div>{/if} {if $slide.link}<a href="{$slide.link}" title="{$slide.link_title}" class="button button-with-icon button-with-arrow">{$slide.link_title}</a>{/if} </div>
                </div>
            </li> {/foreach} </ul>
    </div>
</div>

And my JS :

$(document).ready(function() {
    var speed = 500;
    var sudoSlider = $('#home-slider-content').sudoSlider({
        speed: speed,
        prevNext: false,
        effect: 'revealRight',
        touch: true,
        auto: true,
        continuous: true,
        customLink: '.custom'
        beforeAnimation: function(t) {
            var slidemenu = $('#home-slider-menu');
            var substract = slidemenu.offset();
            var posi = slidemenu.find('ul li').eq(t - 1).offset();
            var left = posi.left - substract.left;
            var width = slidemenu.find('ul li').eq(t - 1).width();
            slidemenu.find('ul li.currentone').animate({
                left: left
            }, speed).children().animate({
                width: width
            }, speed);
            oldt = t;
        },
    });
});

When I click on the link, nothing happened, it's like Javascript was blocking it. Moreover, If I inspect the

webbiesdk commented 8 years ago

Look, that HTML clearly compiles to something else (btw. i fixed the indentation).

So you know what, remove all that code, it is not relevant. Give me a link instead, to a page where the issue is present.

Re-open the issue once that is done.