$(document).ready(function(){
$('.sjimg li img').on('click',function(){
var src = $(this).attr('alt');
var img = '';
//start of new code new code
var index = $(this).parent('li').index();
var html = '';
html += img;
html += '
';
$('#mymodal').modal();
$('#mymodal').on('shown.bs.modal', function(){
$('#mymodal .modal-body').html(html);
//new code
$('a.controls').trigger('click');
})
$('#mymodal').on('hidden.bs.modal', function(){
$('#mymodal .modal-body').html('');
});
});
$('.sjivideo li img').on('click',function(){
var src = $(this).attr('alt');
var img = '';
//var img = '';
//start of new code new code
var index = $(this).parent('li').index();
var html = '';
html += img;
html += '