3
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 function onItemSwitch()
allows me to do anything when the image is changed.
The problem is I’m trying to catch the data-titulo
of each of the images, and put it below the photo of the album.
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 it helps at all.
It worked perfectly Sergio!! Thank you very much! D
– Luan
@Luandavi, you’re welcome. Glad I could help.
– Sergio