File: /var/www/vhosts/creativefellows.nl/test.creativefellows.nl/debets/public/js/app.js
$(document).foundation().ready(function(){
// open external links in new window
$(document.links).filter(function() {
return this.hostname != window.location.hostname;
}).attr('target', '_blank');
$("div.lazy").Lazy({
effect: "fadeIn",
effectTime : 500,
enableThrottle: true,
throttle: 250,
afterLoad: function(){
}
});
$(".page-section .cell").each(function(i, el) {
if ($(el).visible(true)) {
$(el).addClass("already-visible");
}
});
$(window).scroll(function(event) {
$(".page-section .cell").each(function(i, el){
if ($(el).visible(true)) {
$(el).addClass("come-in");
}
});
});
});
$.fn.visible = function(partial) {
var $t = $(this),
$w = $(window),
viewTop = $w.scrollTop()-100,
viewBottom = viewTop + $w.height(),
_top = $t.offset().top,
_bottom = _top + $t.height(),
compareTop = partial === true ? _bottom : _top,
compareBottom = partial === true ? _top : _bottom;
return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
};