0

I am attempting to create a static microsite that has a list of pages. I have a main file 'index.php' with a list of links like the following:

<a href="/pages/page1.php">Go to page 1</a> <a href="/pages/page2.php">Go to page 2</a> 

What I'm trying to do is something like (http://voiceandtone.com/) where when you click on a page it fades-out the current page you are on and animates in the new page without refreshing the page.

Does anyone know how I can achieve this or if there are any great tutorials out there that can help me?

4
  • read about jQuery ajax get. ((google it) Commented Jul 29, 2013 at 20:58
  • possible duplicate of How AJAX is done in github source browse? Commented Jul 29, 2013 at 20:58
  • There are dozens of single page frameworks. My choice was backbone and now chaplin because of coffeescript. You can also change pages with some good looking few css3 transitions. Commented Jul 29, 2013 at 21:04
  • Like others have said you will want to use Ajax to load the pages, you will also want to use history.js to take care of changing the URLs. Check out this stackoverflow.com/a/13314438/1429895 . This is a very good example in jsfiddle that will do what you are trying to do. Commented Jul 29, 2013 at 21:50

2 Answers 2

1

Maybe somethig like this ?

$(document).ready(function() { $("a").click(function() { $('#result').load("http://domain.com" + $(this).attr('href'), function(){ // Stuff to do after the page is loaded }); }); }); 

here is documentation http://api.jquery.com/load/

Sign up to request clarification or add additional context in comments.

Comments

-1

The answer is Ajax. You can use either the GET or POST method to achieve your task.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.