I have this code:
<script>
$(function(){
$(".flipster").flipster({style: 'carousel', enableTouch: true, start: 0,
onItemSwitch: function(){
var nomeAlbum = $(this).attr("data-title");
console.log(nomeAlbum);
}
});
});
</script>
The onItemSwitch()
function allows me to do anything when the image is changed.
The problem is that I'm trying to get the data-titulo
of each of the images, and put it below the album photo.
HTML
<ul>
<li>
<img src="img/californication.jpg" data-title="Californication" class="imgCarousel"/>
<p class="mostra-titulo"></p>
</li>
<li>
<img src="img/greatest-hits.jpg" data-title="Greatest Hits" class="imgCarousel" />
<p class="mostra-titulo"></p>
</li>
<li>
<img src="img/stadium-arcadium.jpg" data-title="Stadium Arcadium" class="imgCarousel" />
<p class="mostra-titulo"></p>
</li>
<li>
<img src="img/the-uplift-mofo-party-plan.jpg" data-title="The Upflit Mofo Party Plan" class="imgCarousel"/>
<p class="mostra-titulo"></p>
</li>
</ul>
Here is the plugin repository , if you help with anything.