Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function blackout(idIB,min,max) {
- if (idIB<min) {idIB=max;}
- if (idIB>max) {idIB=min;}
- // xhr запрос
- var url='program/loadingOf.php?imgB='+idIB;parseInt(idIB)+1;
- xmlhttp.open("GET",url,true);
- xmlhttp.send();
- xmlhttp.onreadystatechange=function() {
- if (xmlhttp.readyState==4) {
- if(xmlhttp.responseText) {
- var resp = xmlhttp.responseText.replace('\r\n', '');
- if (resp!='') {
- var blackout = document.getElementById('blackout');
- blackout.style.width= screen.availWidth+'px';
- blackout.style.height=screen.availHeight+'px';
- blackout.innerHTML = '<img id="imgB" onclick="blackout('+idIB+','+min+','+max+');"/>';
- document.location.hash=n;
- var imgB = document.getElementById('imgB');
- imgB.src='photo/'+resp;
- imgB.style.zIndex='200';
- imgB.style.position='fixed';
- imgB.style.cursor='pointer';
- imgB.style.maxHeight=getViewportHeight();
- imgB.style.maxWidth=screen.availWidth-100;
- imgB.style.left=screen.availWidth/2-imgB.width/2+'px';
- imgB.style.top=getViewportHeight()/2-imgB.height/2+'px';
- var close = document.getElementById('close');
- close.style.left=parseInt(imgB.style.left)+imgB.width+'px';
- close.style.width=screen.availWidth-parseInt(close.style.left)+'px';
- close.style.height=getViewportHeight()+'px';
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment