目录
  1. 1. jqueryUI
    1. 1.1. 下载
    2. 1.2. 引入
    3. 1.3. 使用
jqueryUI插件

jqueryUI

jQuery UI 是建立在 jQuery JavaScript 库上的一组用户界面交互、特效、小部件及主题。

下载

jqueryUI下载

引入

  • 首先得引入jquery的包
  • 其次引入jquery-ui.js的包
  • 然后引入jquery-ui.css包

使用

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="jquery-ui.css">
</head>
<body>

<!-- Accordion: 手风琴-->
<h2>1. Accordion: 手风琴</h2>
<div id="accordion">
<h3>First</h3>
<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
<h3>Second</h3>
<div>Phasellus mattis tincidunt nibh.</div>
<h3>Third</h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>

<!-- 2. Autocomplete: 自动搜索匹配 -->
<h2>Autocomplete</h2>
<div>
<input id="autocomplete" title="type &quot;a&quot;">
</div>

<!-- 3. Tabs: 选项卡 -->
<h2 >3. Tabs: 选项卡</h2>
<div id="tabs">
<ul>
<li><a href="#tabs-1">First</a></li>
<li><a href="#tabs-2">Second</a></li>
<li><a href="#tabs-3">Third</a></li>
</ul>
<div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
<div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div>
<div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
</div>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript">
// 1. Accordion: 手风琴
$('#accordion').accordion()

// 所有数据的数组
var dataSource = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
]

// 2. Autocomplete: 自动搜索匹配
$( "#autocomplete" ).autocomplete({
source: dataSource // 数据源
});

// 3. Tabs: 选项卡
$('#tabs').tabs()

</script>
</body>
</html>

文章作者: Jachie Xie
文章链接: https://xjc5772.github.io/2020-05/27/%E5%AD%A6%E4%B9%A0/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0/JQ/jqueryUI%E6%8F%92%E4%BB%B6/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 XJC&Blog
打赏
  • 微信
  • 支付宝

评论