I want to make a new span class called "button". When the "button" is clicked, it should run jQuery and flip .front not the "button". I tried: $('.button').bind("click",function() { but it only effects the button, not the .front.
HTML:
Run!
jQuery:
$(document).ready(function(){
$('.front').bind("click",function() {
// $(this) point to the clicked .front element (caching it in elem for speed):
var elem = $(this);
// data('flipped') is a flag we set when we flip the element:
if(elem.data('flipped'))
{
// If the element has already been flipped, use the revertFlip method
elem.revertFlip();
// Unsetting the flag:
elem.data('flipped',false)
}
else
{
// Using the flip method defined by the plugin:
elem.flip({
direction:'tb',
speed: 350,
onBefore: function(){
// Insert the contents of the .back div (hidden from view with display:none)
// into the clicked .front div before the flipping animation starts:
elem.html(elem.siblings('.back').html());
}
});
// Setting the flag:
elem.data('flipped',true);
}
});
});
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)