JSFiddle - React, Tailwind, and code Playground
by hobobne
HTML
<div class="Photos">
<a href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">----1-----</a>
</div>
<div class="AppendingDiv" style="border:1px solid blue">
<!-- Here the Photos are going to be appended -->
</div>
JavaScript
$(document).ready(function() {
$(".Photos a").click(function () {
var href_attribute = $(this).attr('href');
var new_item = $('<img src="' + href_attribute + '" />')
.hide()
.load(function () {
alert('Img was loaded! Width: ' + this.width + ' and height: ' + this.height);
})
.fadeIn(2000)
.appendTo('.AppendingDiv');
return false;
});
});