I have been reading stack overflow for a solution but can\'t find it.
(full si
While we use
jQuery(window).load(function($){});
function it's throwing an Uncaught TypeError: $ is not a function
Instead of you can use:
jQuery(document).ready(function ($) {
setTimeout(function(){
//Isotope Code place here
}, 3000);
});
It's working fine.
The problem is that when you run .isotope
the images are not yet loaded, so the plugin cannot calculate their size..
You have some different options to choose from
$(window).load(function(){/*init plugin here*/})
$(window).load(function(){$('#thumbs').isotope('reLayout');});
li
elements are fixed size, then give them dimensions through CSS, and isotope
will pick them up..I fixed it with jquery:
<script type='text/javascript' >
$(window).load(function() {
$.getScript('/js/jquery.isotope.min.js', function() { });
});
</script>
This waits for the whole page to be loaded, then loads the isotope script last. Below, I have a more complete solution, using a "working" notification and a spinner until everything gets loaded. The spinner is from font-awesome icons...
<div class="container wrapper">
<div class="inner_content">
<div class='working' >
<h2>working... <i class="icon-spinner icon-spin icon-large"></i></h2>
</div>
</div>
</div>
<script type='text/javascript' >
$(window).load(function() {
$.getScript('/js/jquery.isotope.min.js', function() {
$('.working').fadeOut();
});
});
</script>
You can see my working example at: http://ericavhay.com/painting/portfolio