mardi 14 avril 2015

Loading images into a new div instead of within the old div

So I have a map where an external page containing some images will be loaded within a div when a marker is selected, now when I click on an image thumbnail in that div, I want to load that image in a new div instead of within that div. This is my code and I couldn't figure out why the images keep loading into the old div. Thanks!



onMarkerClick:function(event, id)
{
// window.location.replace("links/'+code+'.html");
$('#maincontent').load('links/loc'+id+'.html', function(){
$('#maincontent').css('width', 0);
$(this).animate({width: '35%'},
200,function(){});
$('#maincontent img').click(function(){
console.log($(this).attr('src'));
$myFile = $(this).attr('src');
$('#gallery').hide();
/*$('#gallery').css('height',0);*/
$('#gallery').html('<img src="'+$myFile+'" />');
$('#gallery').show();
});
}); },

Aucun commentaire:

Enregistrer un commentaire