function footerFixPosition() { var headHeight = $('#header').height(), sliderHeight = $('#slider').height(), contentHeight = $('#content').height(), winHeight = $(window).height(), both = headHeight + contentHeight + sliderHeight; if (winHeight > both) { return $('.ftr-single').addClass("fix-position-bottom"); } else { return $('.ftr-single').removeClass("fix-position-bottom"); } } function sliderPagination() { var winWidth = $(window).width(), Blt = $(".flex-control-nav li"), BltFirst = $(".flex-control-nav li:first-child"), BltLast = $(".flex-control-nav li:last-child"), BltCount = Blt.length, BltWidth = winWidth / BltCount, BltWidth = Number(BltWidth) - 4; Blt.css('width', BltWidth); BltFirst.css('width', BltWidth + 2); BltLast.css('width', BltWidth + 2); } $('.table-info tr').each(function () { if ($(this).find('td:empty').length) $(this).remove(); }); function main() { var rowCountTableInfo = $('.table-info > tbody > tr').length; if (rowCountTableInfo < 2) { $('.blog-items-info').remove(); $('.blog-content-full-desc').css('width', '100%'); } } $(document).click(function () { $(".fixed-action-btn ul li a").removeClass('view'); }); $(".btn-floating.btn-large").click(function (e) { $(".fixed-action-btn ul li a").toggleClass('view'); e.stopPropagation(); return false; }); function checkLoadMore() { if ($('link[rel=last]').length) { var LP = $('link[rel=last]').attr("href"), LastPage = LP.substring(LP.lastIndexOf("=") + 1, LP.length), LastPage = Number(LastPage), LastPage = LastPage + 1, NP = $('link[rel=next]').attr("href"), NextPage = NP.substring(NP.lastIndexOf("=") + 1, NP.length); if (LastPage != NextPage) { $(".load-more").show(); } } } var PageNumber = 2; function lazyLoad(action) { var url = (document.URL); var urlsplit = url.split("/"); var checkThm = urlsplit[4]; if (checkThm == "project" || checkThm == "research") { pageUrl = window.location.href + "?page=" + PageNumber; var LP = $('link[rel=last]').attr("href"), LastPage = LP.substring(LP.lastIndexOf("=") + 1, LP.length), LastPage = Number(LastPage), LastPage = LastPage + 1, NP = $('link[rel=next]').attr("href"), NextPage = NP.substring(NP.lastIndexOf("=") + 1, NP.length); if (PageNumber < LastPage && LastPage != NextPage) { if (action == true) { $(".page-loader").fadeIn(); loadData(); PageNumber++; } //console.log('LastPage' + LastPage); //console.log('NextPage' + NextPage); //console.log(PageNumber); } if (PageNumber == LastPage) { $(".load-more").hide(0); } } footerFixPosition(); } function loadData() { $.get(pageUrl, function (data) { $(".page-loader").fadeOut(); $(data).find(".new-postlist").appendTo(".post-list-wrp"); checkPostList(); }); } $(".load-more-btn").click(function () { $(".load-more").hide(0); lazyLoad(true); }); $(window).scroll(function () { lazyLoad(false); footerFixPosition(); sliderPagination(); }); setTimeout(main, 200); function noLink() { $(".no-link").click(function (e) { e.preventDefault(); }); } $(window).resize(function () { footerFixPosition(); sliderPagination(); }); $(window).ready(function () { checkLoadMore(); }); if ($.isFunction(mg)) { mg(); }