Can you add history states to ajax/images like fb do.
References
history.pushState(stateObj, "page 2", "bar.html");
http://www.asual.com/jquery/address/
I don't really think it's a good idea to include this by default.I think it's better to use the callback methods.
We are implementing it with callback methods for ajax/inline-frames/images, it would have been great if it was handled within Magnific Popup by default, would make it a lot more great.. just a suggestion. Thanks.!!
----to be placed after
if(!item.src) {
item.src = item.el.attr('href');
}
----Add---
//line added to change url, compensated by window.history.back(); in _close block
window.history.pushState(item.src,item.src,item.src);
// block added to add support for appending secret link at the end of url so as to tell that content is for popup
if(mfp.st.queryAppend != false){
if(item.src.indexOf("?")>0){item.src+='&';}else{item.src+='?';}
item.src+=mfp.st.queryAppend||'content_type=popup';
}
--Add this in _close: function()---
// line added to compensate window.history.pushState(item.src,item.src,item.src); added while loading src
window.history.back();
Thanks for sharing, I'll consider implementing something like this as a separate excludable module.
any development over this idea?
I've tried to implement, but broken when playing with it for more deep click and link.
I have working code,
ajax based: http://www.lastdates.com/
Note:
Hope you get directions.
None of the code I found on the web worked with Magnific Popup's gallery mode, so I've hacked my own solution:
http://eugenedae.github.io/Magnific-Popup-History-API-Demo/
https://github.com/EugeneDae/Magnific-Popup-History-API-Demo
Most helpful comment
None of the code I found on the web worked with Magnific Popup's
gallerymode, so I've hacked my own solution:http://eugenedae.github.io/Magnific-Popup-History-API-Demo/
https://github.com/EugeneDae/Magnific-Popup-History-API-Demo