(function ($) { $(function(){ // add deeplinks share div var $share = $('
'); $share.append( $('') .attr('href', $('.pane-eff-share-blog .share-twitter').attr('href')) ); $share.append( $('') .attr('href', $('.pane-eff-share-blog .share-facebook').attr('href')) ); $('body').append($share); $(document).scroll(function(){ if($(window).width() >= 1070) { // figure out the scroll position to display on var pos = $('.pane-node-body').offset().top + $('.pane-node-body').height() - $(window).height(); // center share div vertically $('#deeplinks-share').css('top', ($(window).height() - $('#deeplinks-share').height()) / 2); if($(document).scrollTop() > pos) { if($('#deeplinks-share').css('display') == 'none') { // display $('#deeplinks-share').fadeIn(600); } } else { if($('#deeplinks-share').css('display') == 'block') { $('#deeplinks-share').fadeOut(600); } } } else { if($('#deeplinks-share').css('display') == 'block') { $('#deeplinks-share').fadeOut(600); } } }); }); })(jQuery);