I can get this to work with a click on a PC, but not with a touch on a mobile device.
$('.img-responsive').on('click', function(){
var src = $(this).attr('src');
$('<div>').css({
background: 'RGBA(0,0,0,.5) url('+src+') no-repeat center',
backgroundSize: 'contain',
width:'100%', height:'100%',
position:'fixed',
zIndex:'10000',
top:'0', left:'0',
cursor: 'zoom-out'
}).on('click', function(){
$(this).remove();
}).appendTo('body');
});
Does anyone have any tips?
thanks!