Jump to content

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");
	});
});

});

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.