0
I am using jQuery Flipster plugin and is giving error "Uncaught Typeerror: Undefined is not a Function"
Follows the HTML:
<input name="carvar" id="carvar" type="text">
<div id="Main-Content">
<div class="Container">
<!-- Flipster List -->
<div class="flipster">
<ul class="flip-items">
<li id="Coverflow-1" title="Cricket" data-flip-category="Fun Sports">
<img src="Escudos/atletico1.png" data-title="Atletico">
<p class="mostra-titulo"></p>
</li>
<li id="Coverflow-1" title="Cricket" data-flip-category="Fun Sports">
<img src="Escudos/botafogo1.png" data-title="Botafogo">
<p class="mostra-titulo"></p>
</li>
<li id="Coverflow-2" title="Surfing" data-flip-category="Fun Sports">
<img src="Escudos/corinthians1.png" data-title="Corinthians">
<p class="mostra-titulo"></p>
</li>
<li id="Coverflow-3" title="Baseball" data-flip-category="Boring Sports">
<img src="Escudos/cruzeiro1.png" data-title="Cruzeiro">
<p class="mostra-titulo"></p>
</li>
<li id="Coverflow-4" title="Running" data-flip-category="Boring Sports">
<img src="Escudos/flamengo1.png" data-title="Flamengo">
<p class="mostra-titulo"></p>
</li>
<li id="Coverflow-7" title="Air Kicking" data-flip-category="These are Sports?">
<img src="Escudos/fluminense1.png" data-title="Fluminense">
<p class="mostra-titulo"></p>
</li>
<li id="Coverflow-6" title="Extreme Bike Sitting" data-flip-category="These are Sports?">
<img src="Escudos/vasco1.png" data-title="Vasco">
<p class="mostra-titulo"></p>
</li>
</ul>
</div>
<!-- End Flipster List -->
</div>
</div>
And here’s the code:
<script>
$(function($){
$(".flipster").flipster({style: 'carousel', enableTouch: true, start: 0, enableNavButtons: true,
onItemSwitch: $('li').each(function(){
var $this = $(this);
var titulo = $this.find('img').data('title');
document.getElementById("carvar").value = titulo;
$this.find('.mostra-titulo').html(titulo);
})
});
});
</script>
Thank you, Vinicius. The error is gone. But at each call of the "onItemSwitch", the code goes through all the "img" by placing in the textbox the value of the variable "title". Only I wanted the "title" variable to keep information only for the selected image. Thank you!
– Flavio Barros
It would be something like recovering the "Selectedindex" or "Currentindex" image.
– Flavio Barros
Thank you Vinicius Montanheiro! It worked perfectly. Abs!
– Flavio Barros