I’m using Cordova to create a mobile app for Android and iOS. On one page, you click a button and the JS loads to show the thumbnails of the category you selected. But the images don’t actually show until you rotate the device. There is space for the thumbnails, but no pictures shown. I see no console errors related to this problem.
What’s weird is that it worked fine when I coded the original code for Android, but then I made changes when iOS showed problems. Now I’m back in Android to see how the iOS changes impacted Android. That’s when this problem surfaced.
I am using Taffy DB and Cordova with materializecss for styling.
You first see a list of buttons with category names on them, such as:
<a id="shocks" href="#" onclick="showShocks();" class="black-text light-blue accent-1 btn chbtn truncate">Shocks</a>
You tap a button. It successfully calls the function that gets the items for that category from the Taffy DB:
function showShocks(){
var show = localStorage.setItem('show','Shocks');
getData();
}
The div for the output is filled with innerHtml:
db({heading:show}).each(function (name){
var heading=(name["heading"]);
var numb=(name["numb"]);
var named=(name["named"]);
output.innerHTML+="<div class='segment'><div class='segmentimg'><img style='max-width:100%;' src='../images/parts/" + numb + "_sm.jpg'>" + "</div>" +
"<p class='title'>#" + numb + " " + named + " <a href='#' onclick=\"window.open('{EDIT}" + numb + "/','_blank','location=yes','closebuttoncaption=Return');\"'><br><span class='black-text light-blue accent-1 btn onbtn'>Online</span></a></p></div>";
});
{EDIT for brevity}
}
Space is made for the thumbnails, but the thumbnails are not showing. Perversely, when I rotated the device, the images popped on!