jQuery(function($) { // jQuery Code $.get('/blog.html', function(data){ // Post Image $(data).find(".blog-post:nth-of-type(1) .wsite-image img").appendTo(".image-1").addClass("first"); // Post Title $(data).find(".blog-post:nth-of-type(1) .blog-title a").appendTo(".title-1"); // Post Tag var tag = $(data).find(".blog-post:nth-of-type(1)").find('img').attr('alt'); $('.blog-tag-1').append(tag); var linkOne = $('.title-1 a').attr('href'); $('.image-1').attr('href', linkOne); // Notification Local Storage $(".close").click(function(){ $(".new-post").hide(); localStorage.setItem('newPost', $(data).find(".blog-post:nth-of-type(1) .blog-title a").text()); }); if(localStorage.getItem('newPost') == $(data).find(".blog-post:nth-of-type(1) .blog-title a").text()) { $(".new-post").hide(); } }); // Attach Post Title Link To Image var linkOne = $('.title-1 a').attr('href'); $('.image-1').attr('href', linkOne); // Notification Scroll $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 10) { $(".new-post").delay(500).addClass("show animated bounceIn"); } }); });