home and lightbox

This commit is contained in:
Karen 2011-11-07 16:23:23 +05:30
commit 1d2f940f40
3 changed files with 19 additions and 10 deletions

View File

@ -303,7 +303,8 @@ color:#FFb400;
font-family:Arial, Helvetica, 'DejaVu Sans', sans-serif;
text-decoration:none;
line-height:14px;
font-weight:bold;}
font-weight:bold;
display:none;}
.moreTab:hover
{text-decoration:underline;

View File

@ -37,11 +37,13 @@ $('#listLeft ul li a').live("click", function() {
});
$('.lightboxNext').live("click", function(e) {
$(this).data("image").click();
var $i = $(this).data("image");
$i.click();
});
$('.lightboxPrev').live("click", function(e) {
$(this).data("image").click();
var $i = $(this).data("image");
$i.click();
});
$('.thumbsDetails').live("click", function(e) {
@ -52,11 +54,11 @@ $('.thumbsDetails').live("click", function(e) {
if (thisIndex < (totalImages - 1)) {
var hasNext = true;
var nextImage = $(this).parent().find(".thumbsDetail").eq(thisIndex + 1);
var nextImage = $(this).parent().find(".thumbsDetails").eq(thisIndex + 1);
}
if (thisIndex > 0 && totalImages > 1) {
var hasPrev = true;
var prevImage = $(this).parent().find(".thumbsDetail").eq(thisIndex - 1);
var prevImage = $(this).parent().find(".thumbsDetails").eq(thisIndex - 1);
}
var bigImage = $(this).attr("data-bigimage");
@ -64,14 +66,15 @@ $('.thumbsDetails').live("click", function(e) {
showLightbox($img);
var title = $(this).hasAttr("title") ? $(this).attr("title") : '';
var $c = $('#lightboxContent');
var $cont = $('.lightboxContainer').appendTo($c);
if (title != '') {
var $caption = $('<div />').addClass("lightboxCaption").text(title).appendTo($c);
var $caption = $('<div />').addClass("lightboxCaption").text(title).appendTo($cont);
}
if (hasNext) {
var $next = $('<div />').addClass("lightboxNext").text("NEXT").data("image", nextImage).appendTo($c);
var $next = $('<div />').addClass("lightboxNext").text("next").data("image", nextImage).appendTo($cont);
}
if (hasPrev) {
var $prev = $('<div />').addClass("lightboxPrev").text("PREV").data("image", prevImage).appendTo($c);
var $prev = $('<div />').addClass("lightboxPrev").text("prev").data("image", prevImage).appendTo($cont);
}
});

View File

@ -240,8 +240,13 @@ str.replace(/[\r\t\n]/g, " ")
<div class="tabText">
{% load thumbnail %}
{% for i in data.imagegallery %}
<a href="{% thumbnail i.file 600x500 quality=60 %}" title="{{i.title}}" class="thickbox" rel="gall">
<img src="{% thumbnail i.file 100x100 autocrop crop %}" />
{% thumbnail i.file "600x500" crop="center" as bigimage %}
<a href="{{ bigimage.url }}" title="{{i.title}}" class="thickbox" rel="gall">
{% endthumbnail %}
{% thumbnail i.file "100x100" crop="center" as thumb %}
<img src="{{ thumb.url }}" />
{% endthumbnail %}
</a>
{% endfor %}
</div>