Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

all carousel items show on page load before only one show

I have a carousel with two items. In testing, only when items should shoud at the time and after swiping ( time delay), the other item will show and the first disappear. However, in my case, on page load, the two items appear on top of each other (similar to the builder view) for a brief second before the second disappear and show only the first one. I have the following related script which I tried on both page load and page show with same problem:

pre//Carousel------------------------------------------

var lng_img = "";
var lng_img = localStorage.getItem("lang");

if(lng_img == "en"){
Appery("mobileimage_62").attr("src", Appery.getImagePath("home_Mevius_DUO_En.jpg"));
Appery("mobileimage_73").attr("src", Appery.getImagePath("home_Winston_Mint_En.jpg"));
}

else if(lng_img == "bm"){
Appery("mobileimage_62").attr("src", Appery.getImagePath("home_Mevius_DUO_BM.jpg"));
Appery("mobileimage_73").attr("src", Appery.getImagePath("home_Winston_Mint_BM.jpg"));
}

else if(lng_img == "ch"){
Appery("mobileimage_62").attr("src", Appery.getImagePath("home_Mevius_DUO_Ch.jpg"));
Appery("mobileimage_73").attr("src", Appery.getImagePath("home_Winston_Mint_Ch.jpg"));
}

//CarouselImages-----------------------------------------

var windowHeight = jQuery(window).height();
//0.35 is 35% you can adjust it in accordance to your needs.
var goalHeight = 0.35 * windowHeight + "px";
Appery("mobileimage_62").height(goalHeight);
Appery("mobileimage_73").height(goalHeight);/pre

Since it's brief and hard to catch it with screenshot (but still annoying specially it's home page where user must go through every time s/he login), I share my App infor in order to reproduce the issue:

link: http://appery.io/app/mobile-frame?src...

credentials: 1234/1234

Nav: just login and you'll find it in home page:

Image

Thank you for your help

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

all carousel items show on page load before only one show

HI Hawk,

As an option, make the second image invisible by default (untick 'visible') and run this code on Page Show event:pre_.defer(function() {
Appery("mobileimage_73").show();
});/pre

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

all carousel items show on page load before only one show

Thanks Kateryna

Return to “Issues”