Skip to content
Snippets Groups Projects
Commit be60b451 authored by Bartek Przybylski's avatar Bartek Przybylski
Browse files

fix albums thumbnails preview for opera

parent afcf9654
Branches
No related tags found
No related merge requests found
...@@ -67,14 +67,14 @@ Albums={ ...@@ -67,14 +67,14 @@ Albums={
$(".gallery_album_cover", local).css('background-repeat', 'no-repeat'); $(".gallery_album_cover", local).css('background-repeat', 'no-repeat');
$(".gallery_album_cover", local).css('background-position', '0'); $(".gallery_album_cover", local).css('background-position', '0');
$(".gallery_album_cover", local).css('background-image','url("'+OC.filePath('gallery','ajax','galleryOp.php')+'?operation=get_covers&albumname='+escape(a.name)+'")'); $(".gallery_album_cover", local).css('background-image','url("'+OC.filePath('gallery','ajax','galleryOp.php')+'?operation=get_covers&albumname='+escape(a.name)+'")');
$(".gallery_album_cover", local).mousemove(function(e) { $(".gallery_album_cover", local).mousemove(function(event) {
var albumMetadata = Albums.find(this.title); var albumMetadata = Albums.find(this.title);
if (albumMetadata == undefined) { if (albumMetadata == undefined) {
return; return;
} }
var x = Math.floor((e.layerX - this.offsetLeft)/(this.offsetWidth/albumMetadata.numOfCovers)); var x = Math.floor(event.offsetX/(this.offsetWidth/albumMetadata.numOfCovers));
x *= this.offsetWidth; x *= this.offsetWidth;
if (x < 0) x=0; if (x < 0 || isNaN(x)) x=0;
$(this).css('background-position', -x+'px 0'); $(this).css('background-position', -x+'px 0');
}); });
$(element).append(local); $(element).append(local);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment