Metro UI CSS 学习笔记之组件(进度条、按钮组和评分)
熊孩纸
阅读:654
2021-03-31 22:43:49
评论:0
查阅Metro UI CSS 对组件(按钮组、评分和进度条)描述,本人觉得已经描述的很详细,所以在这里不打算做详细的讲解,大家可以直接阅读以下源代码(是进过本人已经优化后的代码)。
温馨提示:相关注释,也已经在代码中添加。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!--metro UI css 样式文件(组件基础)-->
<link href="css/metro-bootstrap.css" rel="stylesheet">
<link href="css/metro-bootstrap-responsive.css" rel="stylesheet">
<!--metro UI css 样式文件(组件基础)-->
<link href="css/modern.css" rel="stylesheet">
<link href="css/modern-responsive.css" rel="stylesheet">
<!--加载jquery js 文件-->
<script src="js/jquery/jquery.min.js"></script>
<script src="js/jquery/jquery.widget.min.js"></script>
<!--加载metro js 文件-->
<script src="js/metro/metro.min.js"></script>
<!--加载第三方js 文件-->
<script src="js/modern/dropdown.js"></script><!--下拉菜单第三方控件-->
<script src="js/modern/pagecontrol.js"></script><!--多页控件第三方js-->
<script src="js/modern/accordion.js"></script><!--手风琴第三方js-->
<script src="js/modern/buttonset.js"></script><!--button第三方js-->
<script src="js/modern/rating.js"></script><!--评分第三方js-->
<script src=""></script>
<title>Modern UI CSS 学习笔记</title>
</head>
<body class="modern-ui" style="background: #f1f1f1">
<div class="page">
<div class="page-header">
<div class="page-header-content">
<h3>Metro UI CSS样式文件之组件(按钮组、评分和进度条)</h3>
</div>
</div>
<div class="page-region">
<div class="page-region-content">
<p>按钮组Demo</p>
<div class="grid">
<div class="row">
<div class="span10">
<h2>按钮组</h2>
<div data-role="button-set" class="button-set place-left">
<button class="active">按钮 1</button>
<button>按钮 2</button>
<button>按钮 3</button>
</div>
<div data-role="button-set" class="button-set">
<button class="tool-button active"><img src="./images/bage-playing.png"></button>
<button class="tool-button"><img src="./images/bage-paused.png"></button>
<button class="tool-button"><img src="./images/bage-busy.png"></button>
</div>
<h3>Javascript</h3>
<p>设置当前按钮需要在页面头部加载 <code>buttonset.js</code></p>
</div>
</div>
</div>
<p>评分Demo</p>
<div class="grid">
<div class="row">
<div class="span10">
<h3>静态</h3>
<div>
<div id="rating1" data-param-rating="3.7" data-param-vote="off" data-role="rating" class="rating static-rating" style="width: 135px;"><div class="rating-value" style="width: 74%;"></div></div>
</div>
</div>
</div>
<div class="row">
<div class="span10">
<h3>静态小星</h3>
<div>
<div id="rating2" data-param-stars="6" data-param-rating="3" data-param-vote="off" data-role="rating" class="rating small static-rating" style="width: 84px;"><div class="rating-value" style="width: 50%;"></div></div>
</div>
</div>
</div>
<div class="row">
<div class="span10">
<h3>评级</h3>
<div>
<div id="rating3" data-role="rating" class="rating"><a href="javascript:void(0)"></a><a href="javascript:void(0)"></a><a href="javascript:void(0)"></a><a href="javascript:void(0)"></a><a href="javascript:void(0)"></a></div>
</div>
</div>
</div>
<div class="row">
<div class="span10">
<h3>小的评级</h3>
<div>
<div id="rating4" data-param-rating="4" data-role="rating" class="rating small"><a href="javascript:void(0)" class="rated"></a><a href="javascript:void(0)" class="rated"></a><a href="javascript:void(0)" class="rated"></a><a href="javascript:void(0)" class="rated"></a><a href="javascript:void(0)"></a></div>
</div>
</div>
</div>
</div>
<p>
要使用评级控件,需要在你页面的 <code>head</code>中加载<code>rating.js</code>。
</p>
<p>进度条Demo</p>
<div class="grid">
<div class="row">
<div class="span10">
<h2>进度条</h2>
<div class="progress-bar">
<div style="width: 75%;" class="bar"></div>
</div>
<h2>彩色进度条</h2>
<div class="progress-bar">
<div style="width: 75%;" class="bar bg-color-pink"></div>
</div>
<br>
<div class="progress-bar">
<div style="width: 35%;" class="bar bg-color-blue"></div>
</div>
<br>
<div class="progress-bar">
<div style="width: 55%;" class="bar bg-color-green"></div>
</div>
<h2>多色进度条</h2>
<div data-role="progress-bar" class="progress-bar">
<div style="width: 30%;" data-bar="30" class="bar bg-color-pink"></div>
<div style="width: 30%;" data-bar="30" class="bar bg-color-yellow"></div>
<div style="width: 40%;" data-bar="40" class="bar bg-color-green"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
效果展示:
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。