Версия 12:22, 27 октября 2015 | | Версия 12:23, 27 октября 2015 |
Строка 14: | | Строка 14: |
| addPopupWindow(); | | | addPopupWindow(); |
| $('.Model3DViewer').click(function(){ | | | $('.Model3DViewer').click(function(){ |
? | document.getElementById("popupContent").innerHTML = '<iframe width="'+(document.documentElement.clientWidth-200)+'px" height="'+(document.documentElement.clientHeight-200)+'px" id="Model3D" src="https://sketchfab.com/models/'+$(this).children('div.Model3D').text()+'/embed?autostart=1&preload=1" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>'; | | + | document.getElementById("popupContent").innerHTML = '<iframe width="'+(document.documentElement.clientWidth-150)+'px" height="'+(document.documentElement.clientHeight-150)+'px" id="Model3D" src="https://sketchfab.com/models/'+$(this).children('div.Model3D').text()+'/embed?autostart=1&preload=1" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>'; |
| $('#popupWrapper').show(); | | | $('#popupWrapper').show(); |
| $('#popupWindow').show(); | | | $('#popupWindow').show(); |
Версия 12:23, 27 октября 2015
function addPopupWindow() {
$('body').append(
'<div id="popupWindow"><table><tr><td style="vertical-align: middle;">'+
'<div id="popupOverlay"></div>'+
'<div id="popupWrapper">'+
'<div id="popupContent"></div>'+
'<img src="//wiki.gcdn.co/images/b/bd/Close.png" class="closeBtn">'+
'</div>'+
'</td></tr></table></div>'
);
}
$(document).ready(function() {
addPopupWindow();
$('.Model3DViewer').click(function(){
document.getElementById("popupContent").innerHTML = '<iframe width="'+(document.documentElement.clientWidth-150)+'px" height="'+(document.documentElement.clientHeight-150)+'px" id="Model3D" src="https://sketchfab.com/models/'+$(this).children('div.Model3D').text()+'/embed?autostart=1&preload=1" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
$('#popupWrapper').show();
$('#popupWindow').show();
});
//Закрыть попап кнопкой
$('.closeBtn').click(function(index) {
$('#popupWindow').hide();
});
//Закрыть попап фоном
$('#popupImageOverlay').click(function(index) {
$('#popupWindow').hide();
});
});