Implement Swipe in Venobox lib

Asked

Viewed 76 times

2

Guys I’m using a lib called venobox on a site, but it does not native the Swipe that is the sliding of the image aside to pass it or back and I tried to implement the lib Touchswipe-Jquery-Plugin but it does not work on the images works on div but not on the images, follow my code:

<div id="hover-bg">
    <a class="venobox" data-gall="placas" href="fotos/fotos/10f218859743e9bc947c81570c1066f1.jpg" title="TEXTO DA IMAGEM">
        <div class="hover-text">
            <p class="lead">Placas
                <br />e Fachadas</p>
            <div class="hline"></div>
        </div>
        <img src="img/portfolio/01.jpg" class="img-responsive" alt="...">
    </a>
    <a class="venobox" data-gall="placas" href="fotos/fotos/af62036784528f8773a96bd71b5557b3.jpg" title="TEXTO DA IMAGEM"></a>
    <a class="venobox" data-gall="placas" href="fotos/fotos/cfd8447feaa62c6dcc6cbc1ec4426934.jpg" title="TEXTO DA IMAGEM"></a>
    <a class="venobox" data-gall="placas" href="fotos/fotos/d6a7f824cf38c0a9d04493f394454300.jpg" title="TEXTO DA IMAGEM"></a>
    <a class="venobox" data-gall="placas" href="fotos/fotos/4d801e94fd84df663485178959bf6783.jpg" title="TEXTO DA IMAGEM"></a>
</div>


<script id='code_1'>
    // Aqui deve funcionar o swipe das imagens
    $("#hover-bg").swipe({
        //Generic swipe handler for all directions
        swipe: function(event, direction, distance, duration, fingerCount, fingerData) {
            if (direction == "left") {
                // Preciso chamar o metodo de passar a foto
                // no arquivo galeria/js/venobox.min.js
                alert("Próxima foto");
            } else if (direction == "right") {
                // Preciso chamar o metodo de voltar a foto
                // no arquivo galeria/js/venobox.min.js
                alert("Foto Anterior");
            }
        }
    });

</script>

someone can help me??

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.