27 lines
909 B
JavaScript
27 lines
909 B
JavaScript
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
|
|
addListener(window, 'load', function(){
|
|
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
|
|
var as = document.getElementsByTagName('A');
|
|
var links = [];
|
|
var de = document.documentElement,
|
|
db = document.getElementsByTagName('body')[0],
|
|
w = de.clientWidth || db.clientWidth || window.innerWidth,
|
|
h = de.clientHeight || db.clientHeight || window.innerHeight;
|
|
w = 100*Math.floor(w*0.9/100);
|
|
h = 100*Math.floor(h*0.9/100);
|
|
var t;
|
|
for (var i = 0; i < as.length; i++) {
|
|
if (as[i].getAttribute('rel') == 'lightbox' && !as[i].nolightbox) {
|
|
links.push({
|
|
element: as[i],
|
|
url: as[i].href + (as[i].href.indexOf('?') >= 0 ? '&' : '?') + ('w='+w+'&h='+h),
|
|
title: as[i].title
|
|
});
|
|
}
|
|
}
|
|
setSlimbox(links, {
|
|
counterText: "Изображение {x} из {y}"
|
|
});
|
|
}
|
|
});
|