jquery+svg实现拖动连线答题效果代码
代码语言:html
所属分类:拖放
代码描述:jquery+svg实现拖动连线答题效果代码,支持错误检测提示及默认答案。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
* {
box-sizing:border-box
}
html,body {
height:100%;
background:#f5f5f5;
}
.container {
margin:0 auto;
max-width:960px;
height:100%;
background:#fff;
}
.draw-container {
position:relative;
height:500px;
background:#fff;
}
.btn-group {
position:absolute;
top:0;
right:0;
width:100%;
height:50px;
line-height:50px;
padding:0 20px;
text-align:right;
}
.btn-group a:hover {
color:#66b1ff;
}
.btn-group a {
margin-right:15px;
color:#409eff;
}
a.btn-submit {
color:#67c23a
}
.draw-container ul {
margin-top:80px;
}
.data-list {
position:absolute;
}
.question-list {
left:50px;
}
.answer-list {
right:50px;
}
.data-list li {
margin:15px;
padding:0 10px;
width:100px;
height:30px;
background:#ecf5ff;
line-height:30px;
font-size:16px;
color:#409eff;
border:1px solid #b3d8ff;
border-radius:10px;
cursor:crosshair;
text-align:center
}
.data-list li:hover,.data-list li.selected {
background:#409eff;
border-color:#409eff;
color:#fff;
}
.hover-g {
cursor:pointer;
opacity:1;
stroke-width:4;
}
.remove-btn {
position:absolute;
top:0;
left:0;
width:20px;
height:20px;
background:url('./img/delete-icon.png') no-repeat center;
font-size:14px;
cursor:pointer;
display:none;
}
.result-container {
padding:20px;
border-top:1px solid #333;
}
.result-container li {
font-size:16px;
line-height:35px;
}
</style>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">
<style type="text/css">
.reading h2{width:100%;margin:60px 0;text-align:center;line-height:2;font-size:20px;color:#59595b;}.reading h2 a{text-decoration:none;color:#59595b;font-size:20px;}.reading h2 a:hover{color:#2183f1;}
</style>
</head>
<body>
<div class="container">
<div id="draw" class="draw-container">
<div style="position: absolute" class="btn-group"><a href="javascript:;" id="j-default" title="点击会删除已选择答案">默认答案</a><a href="java.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0