Jump to content

Fade in Fade out and delay not working.


bcode

Recommended Posts

Here is my Javascript that isn't working the way I would expect I am not very fluent with javascript. Wondering where I am going wrong with it you can see the problem on this page http://gen-fan.com/AA_blackreel/index.php it isn't loading back up after the click. What am I doing wrong am I using the functions incorrectly?

 

$(document).ready(function(){
$("#response").css("display", "none");
$("#response").load("main.php");
$("#response").fadeIn(5000);

$("#home").click(function(){
	$("#response").fadeOut(5000);
	$("#response").delay(5000).load("main.php", function(){
		$("#response").fadeIn(5000);
	});
});
$("#about").click(function(){
	$("#response").fadeOut(5000);
	$("#response").delay(5000).load("about.php", function(){
		$("#response").fadeIn(5000);
	});		
});
$("#contact").click(function(){
	$("#response").fadeOut(5000);
	$("#response").delay(5000).load("contact.php", function(){
		$("#response").fadeIn(5000);
	});
});

});

Link to comment
https://forums.phpfreaks.com/topic/227200-fade-in-fade-out-and-delay-not-working/
Share on other sites

Got it to work here is the js

$(document).ready(function(){
$("#response").css("display", "none");
$("#response").load("main.php");
$("#response").fadeIn(5000);

$("#home").click(function(){
	$("#response").fadeOut(5000, function(){
		$("#response").fadeIn(5000).load("main.php");
	});
});
$("#about").click(function(){
	$("#response").fadeOut(5000, function(){
		$("#response").fadeIn(5000).load("about.php");
	});		
});
$("#contact").click(function(){
	$("#response").fadeOut(5000, function(){
		$("#response").fadeIn(5000).load("contact.php");
	});
});

});

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.