var wh = $(window).height(); function getprogress(obj) { obj.attr({ "data-value": parseint(obj.attr("ui-progress")) }); var top = obj.offset().top; var scrolltop = $(document).scrolltop(); if (obj.attr("data-complete") == "off") { return; } else { if (top >= scrolltop && top <= (scrolltop + wh)) { if(parseint(obj.attr("ui-progress")) >=100){ createcircles(obj[0], 100, 45, 112, 112, "#e4393c"); obj.attr("data-complete", "off"); countfun(obj.find("span"), parseint(obj.attr("ui-progress"))); }else { if(obj.attr("ui-progress") > 0 && obj.attr("ui-progress") < 1) { obj.attr("ui-progress", "1"); }else if(obj.attr("ui-progress") > 99 && obj.attr("ui-progress") < 100) { obj.attr("ui-progress", "99"); } obj.attr("data-complete", "off"); countfun(obj.find("span"), parseint(obj.attr("ui-progress"))); createcircles(obj[0], parseint(obj.attr("ui-progress")), 45, 112, 112, "#e4393c"); } } } } $(window).scroll(function() { $(".showlist").find(".holder").each(function(index) { var top = $(this).offset().top; var scrolltop = $(document).scrolltop(); if ($(this).attr("data-complete") == "off") { return; } else { if (top >= scrolltop && top <= (scrolltop + wh)) { if(parseint($(this).attr("ui-progress")) >=100){ createcircles($(this)[0], 100, 45, 112, 112, "#e4393c"); $(this).attr("data-complete", "off"); countfun($(this).find("span"), parseint($(this).attr("ui-progress"))); }else { if($(this).attr("ui-progress") > 0 && $(this).attr("ui-progress") < 1) { $(this).attr("ui-progress", "1"); }else if($(this).attr("ui-progress") > 99 && $(this).attr("ui-progress") < 100) { $(this).attr("ui-progress", "99"); } $(this).attr("data-complete", "off"); countfun($(this).find("span"), parseint($(this).attr("ui-progress"))); createcircles($(this)[0], parseint($(this).attr("ui-progress")), 45, 112, 112, "#e4393c"); } } } }); }); function getcountdown(obj,allowinvesttime,timediff,pd5countdownnum) { var countdown = "pd5-countdownnum"+pd5countdownnum; obj.addclass(countdown); var interval = window.setinterval(function() { var now = new date().gettime(); var second =(allowinvesttime-(now+timediff))/1000; if(second>0){ getrtime(second,countdown); second--; }else{ var parentdiv = $("."+countdown).parent().parent(); var itemid = parentdiv.find("#itemid").val(); var paymentmode = parentdiv.find("#paymentmode").val(); $("."+countdown).parent().remove(); var indexpifhtml = '
' + '

'+paymentmode+'

立即投资' + '
'+ '
' + '
' + '' + '' + '' + '
' + '
'; parentdiv.append(indexpifhtml); countfun(parentdiv.find(".holder").find("span"), 0); createcircles(parentdiv.find(".holder")[0], 0, 45, 112, 112, "#7e7e7e"); clearinterval(interval); } }, "1000"); } function getrtime(second,divname){ var t =second; var dd=math.floor(t/60/60/24); var hh=math.floor(t/60/60%24); var mm=math.floor(t/60%60); var ss=math.floor(t%60); var html = '' + dd + '' + hh + '' + mm + '' + ss + '秒'; var cc = jquery("." + divname).html(html); }