Mark current thumb.

This commit is contained in:
Jason A. Donenfeld 2011-05-09 19:36:15 -04:00
parent e1ac0c410e
commit 04996b8360
2 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,9 @@ a:hover {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.current-thumb {
/* do something to the current thumbnail */
}
#subalbums { #subalbums {
padding-top: 1.5em; padding-top: 1.5em;
} }

View File

@ -125,6 +125,7 @@ $(document).ready(function() {
} }
if (current_photo_cache == null) { if (current_photo_cache == null) {
$("#thumbs img").removeClass("current-thumb");
$("#album-view").removeClass("photo-view-container"); $("#album-view").removeClass("photo-view-container");
$("#subalbums").show(); $("#subalbums").show();
$("#photo-view").hide(); $("#photo-view").hide();
@ -221,6 +222,11 @@ $(document).ready(function() {
scroller.stop().animate({ scrollLeft: thumb.position().left + scroller.scrollLeft() - scroller.width() / 2 + thumb.width() / 2 }, "slow"); scroller.stop().animate({ scrollLeft: thumb.position().left + scroller.scrollLeft() - scroller.width() / 2 + thumb.width() / 2 }, "slow");
} else } else
$("html, body").stop().animate({ scrollTop: thumb.offset().top - $(window).height() / 2 + thumb.height() }, "slow"); $("html, body").stop().animate({ scrollTop: thumb.offset().top - $(window).height() / 2 + thumb.height() }, "slow");
if (current_photo_cache != null) {
$("#thumbs img").removeClass("current-thumb");
thumb.addClass("current-thumb");
}
} }
function currentPhoto() { function currentPhoto() {
for (current_photo_index = 0; current_photo_index < current_album.photos.length; ++current_photo_index) { for (current_photo_index = 0; current_photo_index < current_album.photos.length; ++current_photo_index) {