1 Star 0 Fork 4

了空/kpopup

forked from kalvinmy/kpopup 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo.html 2.62 KB
一键复制 编辑 原始数据 按行查看 历史
kalvinGit 提交于 2019-05-27 21:13 . kpopup
<!DOCTYPE html>
<html>
<head>
<title>kpopup demo</title>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="js/kpopup.js"></script>
</head>
<body>
<div style="text-align: center;">
<div id="topPopup"></div>
<div id="bottomPopup"></div>
<div id="leftPopup"></div>
<div id="rightPopup"></div>
<div id="content" style="display: none;">
我是滑出块内容。。</br>
我是滑出块内容。。</br>
我是滑出块内容。。</br>
重要事,说三遍。。。
</div>
<div style="margin: 200px 300px">
<button type="button" id="topBtn">上滑出</button>
<button type="button" id="bottomBtn">下滑出</button>
<button type="button" id="leftBtn">左滑出</button>
<button type="button" id="rightBtn">右滑出</button>
<br>
<a target="_blank" href="https://tools.kalvinbg.cn">Kalvin在线工具</a>
</div>
</div>
<script type="text/javascript">
$(function() {
// 上滑出层
new popup('#topPopup', '#topBtn', {
// width: '334px', // 滑出层宽度
// height: '170px', // 滑出层调度
content: $('#content'), // 主要内容;可以为html,可以为dom对象
duration: 500 // 滑出速度,默认fast
}).setRight(0).popupTop(); // 可以调用setTop,setRight等方法对滑出层位置进行调整
// 下滑出层
new popup('#bottomPopup', '#bottomBtn', {
// width: '334px', // 滑出层宽度
// height: '170px', // 滑出层调度
content: $('#content'), // 主要内容;可以为html,可以为dom对象
duration: 500 // 滑出速度,默认fast
}).setRight(0).popupBottom(); // 可以调用setTop,setRight等方法对滑出层位置进行调整
// 左滑出层
new popup('#leftPopup', '#leftBtn', {
// width: '334px', // 滑出层宽度
// height: '170px', // 滑出层调度
content: $('#content'), // 主要内容;可以为html,可以为dom对象
duration: 500 // 滑出速度,默认fast
}).popupLeft(); // 可以调用setTop,setRight等方法对滑出层位置进行调整
// 右滑出层
new popup('#rightPopup', '#rightBtn', {
// width: '334px', // 滑出层宽度
// height: '170px', // 滑出层调度
content: $('#content'), // 主要内容;可以为html,可以为dom对象
duration: 500 // 滑出速度,默认fast
}).popupRight(); // 可以调用setTop,setRight等方法对滑出层位置进行调整
});
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/liaokongvfx/kpopup.git
git@gitee.com:liaokongvfx/kpopup.git
liaokongvfx
kpopup
kpopup
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385