aboutus aboutus - 2 months ago 23
jQuery Question

Cordova - How to open to full screen an image (for loop + jQuery)

I store the images in the localStorage, the value is the base64 encoded image.
That function looping through localStorage and get the keys and values, then the jQuery append that image in the html.
My question is, how can i make these generated list of images to be able to go to full screen on tap?

function show() {
$( "#gallery" ).empty();
for(var i=0, len=localStorage.length; i<len; i++) {
var key = localStorage.key(i);
var value = localStorage[key];
$('#gallery').append('<img src=data:image/jpeg;base64,' + value + ' </img>');

I hope my problem is clear, this is my first question here.
Thanks for the answers!

Pat Pat


$('#gallery').on('click', 'img', function(){


.fullscreen {
 position: fixed;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;

This will allow the user to click an image, and if its not fullscreen then make it full screen and vice versa.

If you are specifically talking about a 'tap' (like on a phone) rather than a click you would need to get jQuery mobile and replace 'click' with 'tap' in the jquery code above.