
HTML代碼
~~~
<div class="paotui-head">
<div class="bottom-after myhead">
<img src="img/paotui/people.png" />
<span>跑腿員:金三胖</span>
</div>
</div>
<div class="comment">
<div class="star">
<i data-index="1" class="icon iconfont icon-pingjia-xing2 xing"></i>
<i data-index="2" class="icon iconfont icon-pingjia-xing2 xing"></i>
<i data-index="3" class="icon iconfont icon-pingjia-xing2 xing"></i>
<i data-index="4" class="icon iconfont icon-pingjia-xing2 xing"></i>
<i data-index="5" class="icon iconfont icon-pingjia-xing2 xing"></i>
<input type="hidden" class="star-hidden">
</div>
<div class="comment-slogan">
<div class="slogan-box1">
<div class="slogan-tips">很差,需要改善</div>
</div>
<div class="slogan-box2">
<div class="slogan-tips">比較滿意,但仍可改善</div>
</div>
<div class="slogan-box3">
<div class="slogan-tips">非常滿意,希望能繼續保持</div>
</div>
</div>
</div>
<div class="bottom-button">
<input type="button" value="發布" />
</div>
~~~
css代碼
~~~
body {
background: #f0eff5;
}
.paotui-head {
width: 100%;
height: 60px;
background: #fff;
overflow: hidden;
}
.myhead {
width: 100%;
height: 60px;
margin-left: 10px;
margin-right: 10px;
}
.paotui-head .myhead img {
float: left;
width: 40px;
height: 40px;
margin-top: 10px;
border-radius: 50%;
}
.paotui-head .myhead img+span {
display: inline-block;
height: 20px;
margin-left: 5px;
margin-top: 5px;
font-size: 14px;
color: #666;
line-height: 60px;
}
.comment {
width: 100%;
height: 80px;
padding: 0 20px;
overflow: hidden;
background: #fff;
}
.star {
padding: 12px 0 0;
text-align: center;
}
.star i {
font-size: 26px;
color: #C9CACA;
}
.star i.star-icon-filled {
color: #f5d54b;
}
.comment-slogan {
padding: 0 20px;
}
.slogan-box1, .slogan-box2, .slogan-box3 {
display: none;
}
.slogan-tips {
width: 100%;
padding-top: 10px;
text-align: center;
font-size: 15px;
color: #FF7E01;
overflow: hidden;
}
.bottom-button {
position: fixed;
bottom: 0;
width: 100%;
height: 48px;
}
.bottom-button input[type="button"] {
width: 100%;
height: 48px;
font-size: 16px;
border: none;
background: #ffdc44;
}
.bottom-button input[type="button"]:active {
background: #ffdc44;
color: #000;
}
~~~
js的代碼
~~~
/*選擇評分*/
mui('.star').on('tap','i',function(){
var index = parseInt(this.getAttribute("data-index"));
var parent = this.parentNode;
var children = parent.children;
if(this.classList.contains("xing")){
for(var i=0;i<index;i++){
children[i].classList.remove('xingn');
children[i].classList.add('star-icon-filled');
}
var data = $(this).attr("data-index");
$(".star-hidden").val(data)
}else{
for (var i = index; i < 5; i++) {
children[i].classList.add('xing')
children[i].classList.remove('star-icon-filled')
}
var data = $(this).attr("data-index");
$(".star-hidden").val(data)
}
if (index ==1 || index == 2) {
$(".slogan-box1").slideDown(300);
$(".slogan-box2").hide();
$(".slogan-box3").hide();
$(".question").val("");
}
if (index ==3 || index == 4) {
$(".slogan-box2").slideDown(300);
$(".slogan-box1").hide();
$(".slogan-box3").hide();
$(".question").val("");
}
if (index ==5) {
$(".slogan-box3").slideDown(300);
$(".slogan-box1").hide();
$(".slogan-box2").hide();
$(".question").val("");
}
})
~~~
- mui框架
- toast提示框的使用
- 星級評分
- 上拉刷新和下拉加載里超鏈接失效的原因
- confirm確認框的使用
- 取消下拉刷新和上拉加載的border
- 解決使用加載的方式捕捉不到dom
- css樣式篇
- css3實現0.5像素的邊框
- css3樣式中的border-radius的圓角邊框
- css面試篇之紅色十字架
- css樣式~~用圖片模擬單選框radio的功能
- div設置絕對定位以后,文字實現居中
- 設置input里面字體顏色和大小
- js知識篇
- javascript篇~~九九乘法表
- js~跳轉提示頁面
- js~實現60秒倒計時
- 正則表達式之保留小數點后兩位小數
- 數組操作方法篇
- Array.prototype.filter()的用法
- 使用正則去除空格
- jQuery知識篇
- jQuery~~模仿radio圖片切換
- 下拉菜單的滑動效果
- jQuery點擊切換字體顏色
- jQuery實現圖片和字體圖標顏色的切換
- 左側菜單之當前點擊菜單展開,其他菜單收縮
- jQuery全選或全部不選
- 實現子菜單的收縮和展開
- 小程序
- 小程序~調用豆瓣api數據的問題
- 實現毫秒級倒計時
- 條件渲染-wx:if語句
- 實現兩個頁面共存
- wxss樣式問題
- 修改按鈕默認的border-radius
- 移動端
- 安卓底部按鈕浮上來的解決方法
- excel(xlsx) to json
- vue
- 事件
- 某個元素的點擊事件
- 阻止子事件的冒泡
- excel文件的導入功能(解析成json數據)
- iview框架
- render函數
- iview不支持鍵盤事件的解決方法
- 路由傳參
- 搜索框template的基本寫法
- watch監聽
- 路由發生變化,數據沒有更新?
- 動態組件
- 刷新組件
- 前端小功能
- 搜索框
- axios
- axios公共請求方法
- cookie的簡單使用
- 微信掃碼登錄功能
- pc端微信掃碼登錄-內嵌網頁版
- MongoDB
- 安裝與配置
- 布局
- js判斷打開是PC端還是移動端
- 自適應布局方案-視口布局
- js實現加密和解密的公共方法
- js實現正則表達式匹配的文字加上標簽
- python
- 解決pip升級不成功的原因
- Django
- runserver 失敗的原因