EasyUI jQuery fileBbox widget
EasyUI是一个HTML5框架,用于使用基于jQuery、React、Angular和Vue技术的用户界面组件。它有助于为交互式网络和移动应用程序构建功能,为开发者节省大量时间。
在这篇文章中,我们将学习如何使用jQuery EasyUI设计一个FileBox。FileBox widget代表了HTML表单中的一个文件字段。
EasyUI for jQuery的下载:
https://www.jeasyui.com/download/index.php
语法:
<input class="easyui-FileBox">
属性:
- buttonText。它是一个字符串,定义了按钮的文本。
- buttonIcon: 它是一个字符串,定义了按钮的图标。
- buttonAlign: 它是一个字符串,定义了按钮的位置。
- accept。它是一个字符串,指定服务器接受的文件类型。
- multiple: 它是一个布尔值,定义了是否接受多个文件。
- separator。它定义了多个文件名之间的分隔符。
方法:
- files。它返回选定的文件列表对象。
CDN链接:首先,添加你的项目需要的jQuery Easy UI脚本。
<script type=”text/javascript” src=”jquery.min.js”></script>
<!–jQuery libraries of EasyUI –>
<script type=”text/javascript” src=”jquery.easyui.min.js”> </script>
<!–jQuery library of EasyUI Mobile –>
<script type=”text/javascript” src=”jquery.easyui.mobile.js”> </script>
示例:
<html>
<head>
<!-- EasyUI specific stylesheets -->
<link rel="stylesheet"
type="text/css"
href="themes/metro/easyui.css">
<link rel="stylesheet"
type="text/css"
href="themes/mobile.css">
<link rel="stylesheet"
type="text/css"
href="themes/icon.css">
<!-- jQuery library -->
<script type="text/javascript"
src="jquery.min.js">
</script>
<!-- jQuery libraries of EasyUI -->
<script type="text/javascript"
src="jquery.easyui.min.js">
</script>
<!-- jQuery library of EasyUI Mobile -->
<script type="text/javascript"
src="jquery.easyui.mobile.js">
</script>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h3>EasyUI jQuery filebox widget</h3>
<!-- Define the EasyUI FileBox using markup -->
<input id="gfg" class="easyui-filebox">
</body>
</html>
输出: