开发者

Photoswipe ajax bug

I'm trying to get Photoswipe 2.1.1 working within a jQuery Mobile site using Ajax calls (each page is a separate 开发者_JAVA技巧web-page) but I've found what looks like a bug.

Even in the example file provided with the download this happens.

Try this: from the examples folder, launch 05-jquery-mobile-ajax.html in a web browser. Click through to Gallery1, then hit back button, click Gallery1 again then click on one of the images. The image loads as a straight link (not within Photoswipe).

The first time you click through everything works as expected, but the second time it doesn't. Unfortunately this makes Photoswipe unusable. Can anyone else confirm this?

I'd like to report this as a bug but can't find any way to contact the people at Photoswipe. Let's hope they're watching!

If I can't find a solution can anyone recommend an alternative photo gallery for JQ mobile?


I've been having the exact same problem MikeyB describes.

My solution was to add a rel="external" to the anchor that leads to the Photoswipe gallery page and then use the Photoswipe JS function from the default example (01-default) rather than the JS function from the JQM specific example (05-jquery-mobile-ajax.html).

Remember then to change your unordered list of photos from:

 <ul class="gallery"> 

to:

 <ul id="Gallery" class="gallery">


We have now dealt with this. JQM is doing something funny I think in the latest beta. Have a patch, will be rectified in v2.1.2

Photoswipe is contactable via GitHub as displayed on our website.

Hope this helps!


The problem is that when you click the back button, only the latest 'page' div is reloaded so the js is not reloaded an re-applied. I have been looking for a solution to this as well. I have rel-"external" in all my links and everything works fine. But if the user uses the browser 'back' button, I need a way to force the javascript to reload onto the gallery elements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜