Comments (4)
This is just a demo showing that Magnific Popup can be easily hooked up with History.js and HTML5 History API, not a complete extension. My code probably won't work with AJAX pages out of the box, but it should be easy to make it do so - look for $(document).ready calls and replace them with a "page changed" event listener.
I should note that Magnific Popup itself works perfectly fine with AJAX pages as well Dmitry Semenov's other plugin PhotoSwipe, which has History API support built in.
from magnific-popup-history-api-demo.
Thanks a lot Eugene.
I'm happy with Magnific Popup but want to load some external pages and have their URL displayed correctly for bookmarking etc. It has to be mydomain.com/external.html with external.html loaded as an AJAX page.
Can it be done with Magnific/your code. Or could you recommend an alternative?
from magnific-popup-history-api-demo.
I'm sure it can be done.
The whole code is trivial:
https://github.com/EugeneDae/Magnific-Popup-History-API-Demo/blob/gh-pages/magnific-popup.history.js
This piece reopens the popup when you load a page with the ?item=...
query:
https://github.com/EugeneDae/Magnific-Popup-History-API-Demo/blob/gh-pages/magnific-popup.open-item.js
Example: http://eugenedae.github.io/Magnific-Popup-History-API-Demo/?item=images/forest-h800.jpg
If you want this out of the box, as I said, try http://photoswipe.com/
from magnific-popup-history-api-demo.
I suspect photoswipe works only with images but I want to load HTML pages. Anyways thank you. It seems I'll have to dig into the code=)
from magnific-popup-history-api-demo.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magnific-popup-history-api-demo.