javascript - Creating a slide up transition between two seperate pages -


so have been trying create website has welcome page before enter site , when press enter button first page slides , new page comes underneath.

to give idea of mean here example,http://keepearthquakesweird.com .

you notice when press enter button there page transition different page (take note of url change). trying achieve.

so far have tried alot of different plugins such animsition, (cant remember others :p) nothing has seemed work latest attempt has been iframes (noted url wont change).

latest attempt:

html

<a id="mylink" href="#">             click slide in new page     </a>   <iframe id="newpage" src="https://jsfiddle.net/"></iframe> 

css

#mylink { position: absolute; }  iframe { width: 100%; height: 100%; top: 100%;     position: fixed; background-color: blue; } 

jquery

$(document).ready(function() {     $('#mylink').click(function() {     $('#newpage').transition({top: '0%' });     }); }); 

the page linked uses history api, allows change url address without full page reload. others have said, would:

  1. capture click , load new content via ajax
  2. transition/animate page show new content
  3. update address bar using history api

i suggest using smoothstate.js (a jquery plugin), of above you.

ps: iframes not way go, have different purpose


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -