简体   繁体   中英

jQuery: Move div across pages/url's

Is it possible to animate a div, or any other HTML element on a page refresh using jQuery or a similar web technology?


I am thinking something like the Google Photos search box animation.
When clicking the input, the element remains, while the rest of the page fades out and the URL changes. Then the new elements fade in.


This has to be possible by telling the browser somehow that an element should remain on the page after a request and providing the information, that it is the same as the other element loaded with the request.

This is the combination of two things:

  1. Typical animation (you can do that with jQuery by adding classes and leave animation to CSS or use jQuery Animations https://www.w3schools.com/jquery/jquery_animate.asp )
  2. History API ( https://developer.mozilla.org/en-US/docs/Web/API/History_API ) you can manipulate with URL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM