ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

hello again.
i tried the solutions you proposed (with rendering all pages and not) and both solutions works fine.
then i tried to build a page to show the first image of each gallery (the page is named ("menuGallery") and on click on Image navigate to page with corresponding gallery. and this solution works.

my problem is that i added also a js to open photoswipe directly in flull screen mode after the click on the images clicked in the "menuGallery page and I would like to navigate to the menuGallery page after clicking on the photoswipe close button.
the JS i added to open photoswipe in full screen mode is:

codephotoSwipeInstance = Appery("gallery").find("ul.gallery a").photoSwipe({
jQueryMobile: true,
loop: false,
enableMouseWheel: false,
enableKeyboard: false,
captionAndToolbarAutoHideDelay: 0
}, "gallery");
photoSwipeInstance.show(0); /code

this code is working fine too.

the code i added to navigate to the menuGallery page after clicking on the photoswipe close button is

codephotoSwipeInstance.addEventHandler("PhotoSwipeOnHide", function(e){
Appery.navigateTo('menuGallery',{transition: 'slide',reverse: true});
});/code

but when i test this code on my desktop browser ("chrome") this solution works, while if i test the app on my mobile, when i click on the photoswipe close button, the app navigate firstly to the "menuGallery" page, but then the app automatically navigates to the photoswipe full screen mode page again.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

Hello! Could you clarify what page it navigates to - to the same or another one? Is there picture to navigate to screen with gallery on menuGallery page on position where was photoswipe close button?

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

i have 3 pages. The first is named "menuGallery", the second is named "gallery" and the third is named "gallery_Arte"
in the page "menuGallery" there are 2 images and 2 labels and on click event on the first image the app navigate to the page "gallery"; on click event on the second image the app navigate to the page "gallery_arte"

on the page "gallery" (the same is for the page "gallery_Arte"):

  1. there is a html component containing the html code (named "'html_10") to get images .
    the html component is setted to invisible

  2. on load event i invoke the RESTservice

  3. on page show event i run a js:

    code
    Appery('html_10').html(localStorage.getItem('images_luoghi'));
    photoSwipeInstance = Appery("gallery").find("ul.gallery a").photoSwipe({
    jQueryMobile: true,
    loop: false,
    enableMouseWheel: false,
    enableKeyboard: false,
    captionAndToolbarAutoHideDelay: 0
    }, "gallery");

    photoSwipeInstance.show(0);

    photoSwipeInstance.addEventHandler("PhotoSwipeOnHide", function(e){
    Appery.navigateTo('menuGallery',{transition: 'slide',reverse: true});
    });
    /code

    so when i click on the first image in the "menuGallery" page the app navigates to the page "gallery" and photoswipe starts in the full screen mode.

    from the photoswipe in the full screen mode if i click to the close button in the photoswipe toolbar
    a) by testing in the desktop browser there is a navigation to the "menuGallery" Page (it is what i want to get)
    b) by testing on my mobile there is a navigation to the "menuGallery" Page and then an automatic navigation to the "gallery" page and photoswipe starts in the full screen mode again

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

Hi,

On what device do you test it? What is the iOS version?
Please share the app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

i'm testing the app on galaxy sII Android 4.0.3.
i shared the project named "Strade del Vino CS" with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

if you want to test the galleries you should click on the last image (with yellow ackground) reported in the home screen

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

Hi,

Please replace:prephotoSwipeInstance.addEventHandler("PhotoSwipeOnHide", function(e){
Appery.navigateTo('menuGallery',{transition: 'slide',reverse: true});
});/prewithpre$(".ps-toolbar-content").on("click", function(){
Appery.navigateTo('menuGallery',{transition: 'slide',reverse: true});
});/pre

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

Prolems with photoswipe: [Uncaught Code.PhotoSwipe.createInstance: Instance with id "gallery already exists."]

thanks. i tested the code you propose, bu now.
1) on th desktop it works like before
2) on the mobile (galaxy sII Android 4.0.3.) if i click to the close button in the photoswipe toolbar the app navigate to the page gallery instead of to the page menuGallery

Return to “Issues”