Page 2 of 3

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

Posted: Thu Nov 07, 2013 11:33 am
by ciccio

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.


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

Posted: Thu Nov 07, 2013 1:58 pm
by Maryna Brodina

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?


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

Posted: Thu Nov 07, 2013 3:09 pm
by ciccio

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


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

Posted: Thu Nov 07, 2013 4:58 pm
by Kateryna Grynko

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


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

Posted: Fri Nov 08, 2013 8:20 am
by ciccio

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


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

Posted: Fri Nov 08, 2013 8:22 am
by ciccio

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


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

Posted: Fri Nov 08, 2013 11:39 am
by ciccio

do you have any news about my question?


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

Posted: Fri Nov 08, 2013 11:44 am
by Oleg Danchenkov

Sorry, not yet


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

Posted: Fri Nov 08, 2013 8:19 pm
by Kateryna Grynko

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


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

Posted: Mon Nov 11, 2013 10:25 am
by ciccio

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