Skip to content Skip to sidebar Skip to footer

HTML How To Transition Between Pages

I am currently trying to make a transition between pages on a website. Eg: If a user were on www.example.com/About and they clicked on a link to go to www.example.com/Contact, the

Solution 1:

I don't think you can do that with pure html & js, as you load the entire page each time you click on a link if it's not an anchor.

However you can load just a part of the page, and so apply a transition of your choice with Ajax and js

But in the end, you won't really switch from page to page, but only load the parts that you want to update. This is approximately how modern front end frameworks like Angular, React,... are working

Here is a pure js example http://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_first

Here is a jQuery example http://www.w3schools.com/jquery/ajax_ajax.asp


Solution 2:

You are talking about is page transition and it normally happens in SPA (Single Page Application) where there is no hard refresh.

If you are not working in a SPA application I don't think you can do that where you are moving from one page to another by link/button click and a hard refresh happens.

You can choose angularjs one of the famous spa/mvc framework in jvascript and us ui-router to move from one page to another. there are many other you can explore.


Post a Comment for "HTML How To Transition Between Pages"