var running = 'no'; (function($){ $(window).load(function(){ $("#right_list_contain").mCustomScrollbar({ setTop:"0px" }); }); })(jQuery); var newscroll = lastscroll = ''; $(document).ready(function(e) { $(window).scroll(function(){ if($(window).scrollTop() + $(window).height() == $(document).height()) { getNextContributorsList(); } }); }); //next story list function getNextContributorsList() { if(getstart=='' || getstart==undefined) { getstart = '11'; } if(getkeyword=='' || getkeyword==undefined) { getkeyword = ''; } if(featuredcontributor=='' || getkeyword==undefined){ featuredcontributor=''; } if(running == 'no' && (getpage!='' || getpage!=undefined)) { $('#loader').show(10); running = 'yes'; if(getstart < 5){ getstart = 10; } $.ajax({ type: 'GET', url: site_base_url+'get_contributorslist.php', data: "start="+encodeURIComponent(getstart)+"&keyword="+encodeURIComponent(getkeyword)+"&type="+encodeURIComponent(featuredcontributor), success: function( data ) { $('#loader').hide(10); if(data.match('No More')) { $('.next-story').hide(); //$('#loader').html('');//No More Stories //$('#story_container').append('');//No More Stories $('#loader').hide(10); running = 'yes'; } else if(data!='') { $('.left_sidebar').append(data); sharingIcon(); getstart = parseInt(getstart)+10; running = 'no'; $('#loader').hide(10); $('#left-nav').css('height', $(document).height()); ga('send', 'event', 'NEXT_CONTRIBUTORSLIST', 'click',location.href, getstart, {'nonInteraction': 1}); ga('send', 'pageview', location.href); } }, error: function() { $('#loader').hide(10); alert('Error retreiving data reload and try again.'); } }); } }