$(window).scroll(function() { if ($(this).scrollTop()>100) { $('nav').addClass("nav-fxd"); $('nav li.for-logo').addClass("add-logo"); } else { $('nav').removeClass("nav-fxd"); $('nav li.for-logo').removeClass("add-logo"); } }); $(document).ready(function() { $(window).click(function() { $(".exp-search").slideUp(); $(".exp-search-formobile").slideUp(); }); $('.exp-search').click(function(e){ e.stopPropagation(); }); $('.exp-search-formobile').click(function(e){ e.stopPropagation(); }); $(".mbl-nav").click(function(){ $(".mobile-bg").toggle(); $(".mbl-nav").addClass("afterclick"); $(".mobile-navigation").animate({width: 'toggle'}, 'slow'); $("body").addClass("ovrflhdn"); $(".mbl-nav-clbx").css({"display":"block"}); }); $(".mbl-nav-clbx").click(function(){ $(".mbl-nav-clbx").css({"display":"none"}); $(".mbl-nav").removeClass("afterclick"); $(".mobile-bg").toggle(); $(".mobile-navigation").animate({width: 'toggle'}, 'slow'); $("body").removeClass("ovrflhdn"); }); $(".mobile-bg").click(function(){ $(".mbl-nav-clbx").css({"display":"none"}); $(".mbl-nav").removeClass("afterclick"); $(".mobile-bg").toggle(); $(".mobile-navigation").animate({width: 'toggle'}, 'slow'); $("body").removeClass("ovrflhdn"); }); $("#show-srch-forweb").click(function(e){ e.stopPropagation(); $(".exp-search").slideToggle(); $(".nav-rgt-links li em").removeClass("addcls"); $(".nav-rgt-inside-links").slideUp('fast'); }); $(".srch-for-mbl").click(function(e){ e.stopPropagation(); $(".exp-search-formobile").slideToggle(); }); }); $(document).ready(function(){ $(".nav-rgt-links li:first-child").click(function(){ $(".nav-rgt-links li em").toggleClass("addcls"); $(".exp-search").slideUp(); $(".nav-rgt-inside-links").slideToggle('fast'); }); $('.nws-tab ul li').on('click', function(e){ e.preventDefault(); var $this = $(this); $this.addClass('active').siblings('.nws-tab ul li').removeClass('active'); var tab = $this.data('tag'); $('ul.tnl_listing').hide(); $('ul.'+tab).show(); }); var LocalCurrent=0;var LocalMrgn=0; var localContainer = $('ul#localSlider'); var LocalTotalLi = localContainer.find('li').length; var localContDiv = $('.p18inner').outerWidth() -6; var LocalPageno = Math.ceil(LocalTotalLi/6); localContainer.css('width',LocalPageno*300+'%'); var localLiWidthN = (100/LocalTotalLi); var localUlWidth = localContainer.outerWidth(); var localPage = Math.ceil(localUlWidth/localContDiv); $('a.localArrow').on('click',function(e){ e.preventDefault(); var $this =$(this); var Localdir = $this.data('dir'); LocalCurrent = ( Localdir === 'next' ) ? LocalCurrent+1 : LocalCurrent-1; if( LocalCurrent <=0){ LocalCurrent=0; LocalMrgn = 0; $('a.localArrow.nxt').show();} if(LocalCurrent >=7){ LocalCurrent =0; /*LocalMrgn = 0; */ $('a.localArrow.nxt').hide();} var LocalLiWidth=((300/LocalTotalLi)); //LocalMrgn = LocalCurrent*localContDiv; LocalMrgn+= $('ul#localSlider li:nth-child('+LocalCurrent+')').outerWidth(true); var LocalUnit; if ( Localdir && LocalMrgn !== 0 ) { LocalUnit = ( Localdir === 'next' ) ? '-=' : '+='; } // Animation Here: localContainer.animate({ marginLeft: '-'+LocalMrgn+'' },500); /* LocalMrgn = (LocalCurrent*localContDiv); localContainer.animate({ marginLeft: '-'+LocalMrgn+'%' },500); */ }); $("ul#localSlider li:first-child").trigger('click'); $(".stateList").on("click",function(){ $('#localSlider li').each(function(){ $(this).removeClass('act'); }); $(this).addClass('act'); var stateid = $(this).attr('id'); $.ajax({ type: "GET", url: '/state-'+stateid+'.html', success:function(datareq) { $('#pwidget').html(datareq); } }); }); $.ajax({ url:'/superhitbox.html', type:'GET', success:function(response){ $('div#superhitbox').html(response); }, error:function(){ console.log('Oops! Something went wrong!!'); } }); var sLocalCurrent=0;var sLocalMrgn=0; var slocalContainer = $('ul#slocalSlider'); var sLocalTotalLi = slocalContainer.find('li').length; var slocalContDiv = $('.n18inner').outerWidth() -6; var sLocalPageno = Math.ceil(sLocalTotalLi/6); slocalContainer.css('width',sLocalPageno*300+'%'); var localLiWidthN = (100/sLocalTotalLi); var slocalUlWidth = slocalContainer.outerWidth(); var localPage = Math.ceil(slocalUlWidth/slocalContDiv); $('a.slocalArrow').on('click',function(e){ e.preventDefault(); var $this =$(this); var sLocaldir = $this.data('dir'); sLocalCurrent = ( sLocaldir === 'next' ) ? sLocalCurrent+1 : sLocalCurrent-1; if( sLocalCurrent <=0){ sLocalCurrent=0; sLocalMrgn = 0;$('a.slocalArrow.nxt').show();} if(sLocalCurrent >=7){ sLocalCurrent =0; /* sLocalMrgn = 0; */ $('a.slocalArrow.nxt').hide();} var LocalLiWidth=((300/sLocalTotalLi)); //LocalMrgn = LocalCurrent*localContDiv; sLocalMrgn+= $('ul#slocalSlider li:nth-child('+sLocalCurrent+')').outerWidth(true); var LocalUnit; if ( sLocaldir && sLocalMrgn !== 0 ) { LocalUnit = ( sLocaldir === 'next' ) ? '-=' : '+='; } // Animation Here: slocalContainer.animate({ marginLeft: '-'+sLocalMrgn+'' },500); /* LocalMrgn = (LocalCurrent*localContDiv); localContainer.animate({ marginLeft: '-'+LocalMrgn+'%' },500); */ }); }); function getbreaking(){ $.ajax({ url:'../../ajax-breaking.php', type:'GET', success:function(response){ $('div#breakingflash').html(response); // setTimeout('getbreaking();', 30000); }, error:function(){ console.log('Something went wrong..'); } }); } function convertedToSlug(Text) { if(Text) { return Text .toLowerCase() .replace(/[^\w ]+/g,'') .replace(/ +/g,'-') ; } } // Get left ScoreCard Widgets: function getLeftScoreCardWedget(){ $.ajax({ type: "GET", crossDomain: true, jsonpCallback: 'scores', dataType: "jsonp", cache:true, jsonp: 'jsonp', url: 'https://cricketnext.nw18.com/json/crosslivescores.json', success: function(response){ //console.log(response); var matchesDetails = response.matches; var liveMatchListing=''; var countMatch=0; $.each(matchesDetails,function(i, liveMatches){ //console.log(i); //console.log(liveMatches); var fteamNameA = liveMatches.hometeam; var fteamNameB = liveMatches.awayteam; var fMatchId = liveMatches.matchid; var series = liveMatches.series.toLowerCase(); series = series.replace(",",""); series = series.replace(/\s+/g,"-"); var seriesname = convertedToSlug(liveMatches.series_full); var urlTeam = convertedToSlug(fteamNameA)+'-'+convertedToSlug(fteamNameB); if(i==0){ //console.log(liveMatchesD); var flscorelink = '/scorecard/full/'+urlTeam+'/'+fMatchId+'.html'; $('.top_live_score a').attr('href', flscorelink); } var teamAScore=liveMatches.teama.scores; var teamBScore=liveMatches.teamb.scores; var seriesFullName = liveMatches.series; var fullScoreCardLink = '/scorecard/full/'+urlTeam+'/'+fMatchId+'.html'; var liveMatchData = getWidgetActiveTeam(teamAScore,teamBScore,fullScoreCardLink); liveMatchListing+='