Insert jquery Cycle 2 in wordpress

Asked

Viewed 63 times

0

<!--cycle6-->

<?php
   wp_enqueue_script('jquery.cycle.all.js', '/wp-content/themes/powerclub-lite/js/jquery.cycle2.js', array('jquery'));
wp_enqueue_script('jquery.cycle2.flip.js', '/wp-content/themes/powerclub-lite/js/jquery.cycle2.flip.js');
   wp_head();
   wp_enqueue_script('cycle6', '/wp-content/themes/powerclub-lite/js/cycle6.js');
   wp_head();
?>
.galeria1 {width: 50%}
.galeria1  img {width: 100%; Altura: auto}
<!-- inicio jq cycle body -->
<div style="" id="galeria1"> <img style="position: absolute; top: 0px; left: 0px; display: block; z-index: 5; opacity: 1;" src="http://localhost/academia/wp-content/uploads/2017/06/home_historia_1-min-1.png" alt="Primeira Foto" /><img style="position: absolute; top: 0px; left: 0px; display: block; z-index: 4; opacity: 1;" src="http://localhost/academia/wp-content/uploads/2017/06/home_matematica_3-min-1.png" alt="Primeira Foto" /></div>

<!-- fim jq cycle body →

I managed to insert jquery Cycle 1 in wordpress normally, but with cycle2, I’m trying for days, I’ve searched a lot and nothing, so I’m asking for help.

2 answers

0

I got it this way:

<!--no header.php do tema-->

<script src="http://malsup.github.io/jquery.cycle2.js"></script>
<script src="http://malsup.github.io/jquery.cycle2.flip.js"></script>
<div class="cycle-slideshow" 
    data-cycle-fx=flipHorz
    data-cycle-timeout=2000
    >
    <img src="http://malsup.github.io/images/p1.jpg"/>
    <img src="http://malsup.github.io/images/p2.jpg"/>
    <img src="http://malsup.github.io/images/p3.jpg"/>
    <img src="http://malsup.github.io/images/p4.jpg"/>
</div>

0

At first, insert in the form of HTML to see what is going wrong. Do this on header.php from your template. See:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script src="/wp-content/themes/powerclub-lite/js/jquery.cycle2.js"></script>

<script src="/wp-content/themes/powerclub-lite/js/jquery.cycle2.flip.js"></script>
  • Thanks, nothing happened, no error and the effect didn’t work. jQuery(Document). ready(Function($) { $('#galeria1').Cycle('flipHorz'); }); the effect hangs, if you put the cycle1 effect works, like zoom, this effect I want to use:<div class="Cycle-slideshow" data-Cycle-fx=flipHorz data-Cycle-timeout=2000 > <img src="http://malsup.github.io/images/p1.jpg"> <img src="http://malsup.github.io/images/p2.jpg"> <img src="http://malsup.github.io/images/p3.jpg"> <img src="http://malsup.git.io/images/p4jpg"> </div>

Browser other questions tagged

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