分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

JS——jquery UI

发布时间:2023-09-06 02:01责任编辑:蔡小小关键词:暂无标签

    1. draggable()

滑动条demo:

<!DOCTYPE html><html lang="en"><head> ???<meta charset="UTF-8"> ???<title>Title</title> ???<style type="text/css"> ???????.con{ ???????????width:300px; ???????????height:300px; ???????????border:1px solid #000; ???????????margin:50px auto 0; ???????} ???????.box{ ???????????width:50px; ???????????height:50px; ???????????background-color:hotpink; ???????????cursor:pointer; ???????} ???</style> ???<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script> ???<script type="text/javascript" src="js/jquery-ui.min.js"></script> ???<script type="text/javascript"> ???????$(function () { ???????????//使得box可以鼠标拖动 ???????????$(‘.box‘).draggable({ ???????????????//约束元素在父级内拖动 ???????????????containment:‘parent‘, ???????????????//约束元素只能横向拖动 ???????????????axis:‘x‘, ???????????????//元素拖动时透明度变为0.6 ???????????????opacity:0.6, ???????????????//ui里面有什么可以用console.log(ui)查看 ???????????????drag:function (ev,ui) { ???????????????????var nowleft = ui.position.left; ???????????????} ???????????}); ???????}) ???</script></head><body> ???<div class="con"> ???????<div class="box"></div> ???</div></body></html>

JS——jquery UI

原文地址:https://www.cnblogs.com/gaoquanquan/p/9226534.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved