HTML:
<html>
<head>
</head>
<body>
<a class='img' href="img1">Image 1</a>
<a class='img' href="img2">Image 2</a>
<div class="image-viewer" style="display:none"><p></p>
<a class="close" href="">Close</a>
</div>
</body>
</html>
JS:
$(function() {
var begin=location.href;
$(".img").on('click', function(e) {
console.log(location.href);
var href = $(this).attr("href")
History.pushState({"state": href, "rand": Math.random()}, "", href);
console.log(location.href);
e.preventDefault();
});
History.Adapter.bind(window, 'statechange', function() {
$(".image-viewer p").html(History.getState());
$(".image-viewer").show();
});
$(".close").click( function(e) {
e.preventDefault();
console.log($(this).parent());
$(this).parent().fadeOut(1);
History.pushState({"state": begin, "rand": Math.random()}, "", begin);
});
})
http://jsfiddle.net/rAxAw/2/
さらにサポートが必要な場合は、qnにお気軽にお問い合わせください