javascript 5分钟自动网络研讨会

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 5分钟自动网络研讨会相关的知识,希望对你有一定的参考价值。

<script src="https://cdn.jsdelivr.net/handlebarsjs/4.0.5/handlebars.min.js"></script>
<script>
/**************************
* Copyright 2017 CF Pro Tools, All Rights Reserved
* Do not share, or distribute this code without author's consent.
* Author: Jaime Smith
* Website: https://cfprotools.com
modified by Melinda Evans melindae@gmail.com
**************************/
$(function() {
    var $webinar_dt = moment().minute(5).seconds(0);
	var minutes = moment().minutes();
	console.log('minutes: '+minutes);
	if (minutes >= 55) {
		$webinar_dt = moment().add(1, 'hour').startOf('hour');
	} else if (minutes >= 50) {
    	$webinar_dt = moment().minute(55).seconds(0);
	} else if (minutes >= 45) {
    	$webinar_dt = moment().minute(50).seconds(0);
	} else if (minutes >= 40) {
    	$webinar_dt = moment().minute(45).seconds(0);
	} else if (minutes >= 35) {
    	$webinar_dt = moment().minute(40).seconds(0);
	} else if (minutes >= 30) {
    	$webinar_dt = moment().minute(35).seconds(0);
	} else if (minutes >= 25) {
    	$webinar_dt = moment().minute(30).seconds(0);
	} else if (minutes >= 20) {
    	$webinar_dt = moment().minute(25).seconds(0);
	} else if (minutes >= 15) {
    	$webinar_dt = moment().minute(20).seconds(0);
	} else if (minutes >= 10) {
    	$webinar_dt = moment().minute(15).seconds(0);
	} else if (minutes >= 5) {
    	$webinar_dt = moment().minute(10).seconds(0);
	} else if (minutes >= 0) {
    	$webinar_dt = moment().minute(5).seconds(0);
	}
	console.log($webinar_dt.format());
	time_now_diff_seconds = $webinar_dt.diff(moment(), 'seconds');
	wt_formatted = $webinar_dt.format('h:mm A');
	$('[data-title*="cfe15-time"]').each(function () {
		var $source = $(this).html();
		var template = Handlebars.compile($source);
		var data = {
			"webinar_time": wt_formatted
		}
		var html = template(data);
		$(this).html(html);
	});
	$.countdown.setDefaults($.countdown.regionalOptions["eng"]);
	$('[data-title*="cfe15-countdown"]').each(function () {
		var newClasses = $(this).find('div').first().attr("class");
		var currClasses = $(this).attr("class");
		$(this).countdown({
		    until: time_now_diff_seconds,
		    padZeroes: true,
		    onExpiry: function () { window.location.reload(); }
		 }).attr("class",newClasses).wrap('<div class="'+currClasses+'"></div>');
	});
	setWebinarTime();
	// set value of webinar
	$('[href="#submit-form"]').on('click', function(e) {
	  setWebinarTime();
	});
	function setWebinarTime() {
		now = moment();
		now_offset = moment.unix(now);
	  $("#webinar_delay").attr("value", $webinar_dt.diff(moment()));
	}
});
</script>

<style>
.is-countdown {
	display: inline-block !important;
}
</style>
<script src="https://cdn.jsdelivr.net/handlebarsjs/4.0.5/handlebars.min.js"></script>
<script>
/**************************
* Copyright 2017 CF Pro Tools, All Rights Reserved
* Do not share, or distribute this code without author's consent.
* Author: Jaime Smith
* Website: https://cfprotools.com
modified by Melinda Evans melindae@gmail.com
**************************/
$(function() {
  var $webinar_dt = moment().minute(5).seconds(0);
var minutes = moment().minutes();
console.log('minutes: '+minutes);
if (minutes >= 55) {
  $webinar_dt = moment().add(1, 'hour').startOf('hour');
} else if (minutes >= 50) {
    $webinar_dt = moment().minute(55).seconds(0);
} else if (minutes >= 45) {
    $webinar_dt = moment().minute(50).seconds(0);
} else if (minutes >= 40) {
    $webinar_dt = moment().minute(45).seconds(0);
} else if (minutes >= 35) {
    $webinar_dt = moment().minute(40).seconds(0);
} else if (minutes >= 30) {
    $webinar_dt = moment().minute(35).seconds(0);
} else if (minutes >= 25) {
    $webinar_dt = moment().minute(30).seconds(0);
} else if (minutes >= 20) {
    $webinar_dt = moment().minute(25).seconds(0);
} else if (minutes >= 15) {
    $webinar_dt = moment().minute(20).seconds(0);
} else if (minutes >= 10) {
    $webinar_dt = moment().minute(15).seconds(0);
} else if (minutes >= 5) {
    $webinar_dt = moment().minute(10).seconds(0);
} else if (minutes >= 0) {
    $webinar_dt = moment().minute(5).seconds(0);
}
	console.log($webinar_dt.format());
	time_now_diff_seconds = $webinar_dt.diff(moment(), 'seconds');
	wt_formatted = $webinar_dt.format('h:mm A');
	$('[data-title*="cfe15-time"]').each(function () {
		var $source = $(this).html();
		var template = Handlebars.compile($source);
		var data = {
			"webinar_time": wt_formatted
		}
		var html = template(data);
		$(this).html(html);
	});
	$.countdown.setDefaults($.countdown.regionalOptions["eng"]);
	$('[data-title*="cfe15-countdown"]').each(function () {
		var newClasses = $(this).find('div').first().attr("class");
		var currClasses = $(this).attr("class");
		$(this).countdown({
		    until: time_now_diff_seconds,
		    padZeroes: true,
		    onExpiry: function () { window.location.reload(); }
		 }).attr("class",newClasses).wrap('<div class="'+currClasses+'"></div>');
	});
	setWebinarTime();
	// set value of webinar
	$('[href="#submit-form"]').on('click', function(e) {
	  setWebinarTime();
	});
	function setWebinarTime() {
		now = moment();
		now_offset = moment.unix(now);
	  $("#webinar_delay").attr("value", $webinar_dt.diff(moment()));
	}
});
</script>

<style>
.is-countdown {
	display: inline-block !important;
}
</style>

以上是关于javascript 5分钟自动网络研讨会的主要内容,如果未能解决你的问题,请参考以下文章

javascript 使用以太坊的网络界面探索智能合约,并为iMAL的区块链研讨会提供可靠性

ESI集团“How do I…”系列网络研讨会——如何创建自动化脚本以提高声学仿真的有效性

下午2点见|“如何解决网络隔离与安全文件交换的困局”网络研讨会

第一天 | 好书送不停 |《Selenium WebDriver 3.0 自动化测试框架实战指南》书籍(10本)

蚁景科技受邀参加中国刑事警察学院学科专业建设研讨会

web 实现5分钟 鼠标键盘无操作,自动退出登陆