【发布时间】:2020-12-07 23:30:53
【问题描述】:
我正在构建一个网络应用程序,我希望有一个 typeform 类似的流程来在我的网站上创建和编辑实体。 据我所知,我不能使用 typeform 本身,因为它们不允许编辑。
是否有工具/sn-p/package 可以创建美观的表单,无需在页面之间刷新,包括动画、跳过逻辑等?
我正在为我的网站使用 django。
谢谢!
编辑 1
尝试使用 Barba.js,但我遇到了输入转换问题。 退出转换工作正常,但由于某种原因进入转换不起作用。
新的只是出现而不淡入。
HTML 测试:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BarbaJS legacy example</title>
</head>
<body>
{% load static %}
<!-- define the wrapper and the container -->
<div data-barba="wrapper">
<h1>
base base base
</h1>
<div data-barba="container" data-barba-namespace="test-1" id="test">
<h3>
this text should be replaced
</h3>
<a href="/test2">test</a>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- load barba (UMD version) -->
<script src="https://cdn.jsdelivr.net/npm/@barba/core"></script>
<script src="{% static "app/js/test.js" %}"></script>
</body>
</html>
HTML 测试 2:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BarbaJS legacy example</title>
</head>
<body>
{% load static %}
<!-- define the wrapper and the container -->
<div data-barba="wrapper">
<h1>
base base base
</h1>
<div data-barba="container" data-barba-namespace="test-1" id="test">
<h3>
New text
New text
New text
</h3>
<a href="/test">test</a>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- load barba (UMD version) -->
<script src="https://cdn.jsdelivr.net/npm/@barba/core"></script>
<script src="{% static "app/js/test.js" %}"></script>
</body>
</html>
JS:
$(document).ready(function () {
barba.init({
transitions: [{
leave(data) {
return $(data.current.container).fadeOut().promise()
},
enter(data) {
return $(data.next.container).fadeIn().promise()
}
}]
});
});
【问题讨论】:
标签: html django django-forms