html5页⾯答题算分,JavaScript实现答题评分功能页⾯本⽂实例为⼤家分享了JavaScript实现答题评分功能的具体代码,供⼤家参考,具体内容如下
效果图
直接上代码
HTML部分
JavaScript实现⼀个在线做题测试⽹页
在线答题
测试已开始,请开始作答,请在30分钟内完成答题
提交
CSS部分
index.css
timeTo.css
figure, figcaption {
display: block;
}
.transition {
-webkit-transition: top 400ms linear;
-moz-transition: top 400ms linear;
-ms-transition: top 400ms linear;
-o-transition: top 400ms linear;
transition: top 400ms linear;
}
.timeTo {
font-family: Tahoma, Verdana, Aial, sans-serif;
font-size: 28px;
line-height: 108%;
font-weight: bold;
height: 32px;
}
.timeTo span {
vertical-align: top;
}
.timeTo.timeTo-white div {
color: black;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 38%, #cccccc 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(38%,#ffffff), color-stop(100%,#cccccc)); /*
Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 38%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 38%,#cccccc 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 38%,#cccccc 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 38%,#cccccc 100%); /* W3C */
filter: progid:adient( startColorstr='#ffffff', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
}
.timeTo.timeTo-black div {
color: white;
background: #45484d; /* Old browsers */
background: -moz-linear-gradient(top, #45484d 0%, #000000 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#45484d), color-stop(100%,#000000)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #45484d 0%,#000000 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #45484d 0%,#000000 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #45484d 0%,#000000 100%); /* IE10+ */
background: linear-gradient(to bottom, #45484d 0%,#000000 100%); /* W3C */
filter: progid:adient( startColorstr='#45484d', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
}
.timeTo.timeTo-black .timeTo-alert {
background: #a74444; /* Old browsers */
background: -moz-linear-gradient(top, #a74444 0%, #3f0000 67%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#a74444), color-stop(67%,#3f0000)); /*
Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #a74444 0%,#3f0000 67%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #a74444 0%,#3f0000 67%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #a74444 0%,#3f0000 67%); /* IE10+ */
background: linear-gradient(to bottom, #a74444 0%,#3f0000 67%); /* W3C */
filter: progid:adient( startColorstr='#a74444', endColorstr='#3f0000',GradientType=0 ); /* IE6-9 */
}
.timeTo.timeTo-white .timeTo-alert {
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 35%, #e17373 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(35%,#ffffff), color-stop(100%,#e17373)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 35%,#e17373 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 35%,#e17373 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 35%,#e17373 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 35%,#e17373 100%); /* W3C */
filter: progid:adient( startColorstr='#ffffff', endColorstr='#e17373',GradientType=0 ); /*
IE6-9 */
}
.timeTo figure {
display: inline-block;
margin: 0;
padding: 0;
}
.timeTo figcaption {
text-align: center;
/*font-size: 12px;*/
line-height: 80%;
font-weight: normal;
color: #888;
}
.timeTo div {
position: relative;
display: inline-block;
width: 25px;
height: 30px;
border-top: 1px solid silver;
border-right: 1px solid silver;
border-bottom: 1px solid silver; overflow: hidden;
}
.
timeTo div.first {
border-left: 1px solid silver;
}
.timeTo ul {
list-style-type: none;
margin: 0;
padding: 0;
position: absolute;
left: 3px;
}
.timeTo ul li {
margin: 0;
padding: 0;
list-style: none;
}
jquery.time-to.js部分
/**
* Time-To jQuery plug-in
* Show countdown timer or realtime clock *
* @author Oleksii Teterin
* @version 1.3.0
* @date 2019-05-14
如何启用javascript功能
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD (RequireJS)
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS (Node)
/* eslint-disable import/no-unresolved */
} else {
// globals
factory(jQuery);
}
}(function ($) {
var SECONDS_PER_DAY = 86400;
var SECONDS_PER_HOUR = 3600;
/* eslint-disable no-multi-spaces */
var defaults = {
callback: null, // callback function for exec when timer out
step: null, // callback function to exec every {stepCount} ticks
stepCount: 1, // number of ticks to increment before executing stepCount captionSize: 0, // font-size by pixels for captions, if 0 then calculate automaticaly countdown: true, // is countdown or real clock
countdownAlertLimit: 10, // limit in seconds when display red background displayCaptions: false, // display captions under digit groups
displayDays: 0, // display day timer, count of days digits
displayHours: true, // display hours
fontFamily: 'Verdana, sans-serif',
fontSize: 0, // font-size of a digit by pixels (0 - use CSS instead)
lang: 'en', // language of caption
languages: {}, // extra or overridden languages
seconds: 0, // timer's countdown value in seconds

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。