This is my javascript
$(document).ready(function(){
$('.frontpageimg').click(function(){
$(this).data('clicked', true);
});
if('.frontpageimg').data('clicked') {
$('#imagepos').slideUp(2000).fadeOut(2000);
$('#contentpos').slideUp(2000).fadeIn(2000);
} else {
$('#imagepos').delay(8000).slideUp(2000).fadeOut(2000);
$('#contentpos').delay(8000).slideUp(2000).fadeIn(5000);
}
});
The website animates to show the main content after a delay, which is what's supposed to happen. However, I want the user to be able to skip waiting and activate a shorter animation by clicking on an image. Currently everything under the 'else' part works, but nothing happens when the image is clicked.
EDIT: I've changed the code in an attempt to get things working, still doesn't do what I want it to.
$(document).ready(function(){
$('#imagepos').delay(8000).slideUp(2000).fadeOut(2000);
$('#contentpos').delay(8000).slideUp(2000).fadeIn(5000);
});
$('#frontpageimg').click(function(){
$('div:animated').stop();
$('div:animated').clearQueue();
$('#imagepos').slideUp(2000).fadeOut(2000);
$('#contentpos').slideUp(2000).fadeIn(2000);
});
if('.frontpageimg')ifline