URL Hashes
This commit is contained in:
parent
e8c7c5d1a7
commit
f87af86cb4
|
@ -12,6 +12,7 @@ $(function(){
|
||||||
var project_id = $this.attr("data-id");
|
var project_id = $this.attr("data-id");
|
||||||
// doProjectLoading();
|
// doProjectLoading();
|
||||||
$.getJSON("project_json", {'id': project_id}, function(data) {
|
$.getJSON("project_json", {'id': project_id}, function(data) {
|
||||||
|
location.hash = data.slug;
|
||||||
$('#projectTitle').next().text(data.title);
|
$('#projectTitle').next().text(data.title);
|
||||||
$('#projectSizeProgram').next().html(nl2br(data.size_program));
|
$('#projectSizeProgram').next().html(nl2br(data.size_program));
|
||||||
$('#projectDesignStatement').next().html(nl2br(data.design_statement));
|
$('#projectDesignStatement').next().html(nl2br(data.design_statement));
|
||||||
|
@ -30,9 +31,21 @@ $(function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.projectThumb').eq(0).click();
|
|
||||||
|
var hash = location.hash;
|
||||||
|
if (hash == '') {
|
||||||
|
$('.projectThumb').eq(0).click();
|
||||||
|
} else {
|
||||||
|
var $thumb = $('#thumb_' + hash);
|
||||||
|
if ($thumb.length > 0) {
|
||||||
|
$thumb.click();
|
||||||
|
} else {
|
||||||
|
$('.projectThumb').eq(0).click();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function getA(image) {
|
function getA(image) {
|
||||||
var $a = $('<a />').attr("href", "#");
|
var $a = $('<a />').attr("href", "#");
|
||||||
var $img = $('<img />').attr("src", image.url).appendTo($a);
|
var $img = $('<img />').attr("src", image.url).appendTo($a);
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
{% load thumbnail %}
|
{% load thumbnail %}
|
||||||
{% for p in projects %}
|
{% for p in projects %}
|
||||||
{% thumbnail p.thumb_image "100x100" crop="center" as im %}
|
{% thumbnail p.thumb_image "100x100" crop="center" as im %}
|
||||||
<li><img src="{{ im.url }}" data-id="{{ p.id }}" width="100" height="100" alt="{{ p.title }}" class="projectThumb" /></li>
|
<li><img id="thumb_{{ p.slug }}" src="{{ im.url }}" data-id="{{ p.id }}" width="100" height="100" alt="{{ p.title }}" class="projectThumb" /></li>
|
||||||
{% endthumbnail %}
|
{% endthumbnail %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user