微信小程序如何實(shí)現(xiàn)點(diǎn)擊圖片旋轉(zhuǎn)180度并且彈出下拉列表-創(chuàng)新互聯(lián)

這篇文章將為大家詳細(xì)講解有關(guān)微信小程序如何實(shí)現(xiàn)點(diǎn)擊圖片旋轉(zhuǎn)180度并且彈出下拉列表,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

堅(jiān)守“ 做人真誠(chéng) · 做事靠譜 · 口碑至上 · 高效敬業(yè) ”的價(jià)值觀,專業(yè)網(wǎng)站建設(shè)服務(wù)10余年為成都成都宣傳片制作小微創(chuàng)業(yè)公司專業(yè)提供企業(yè)網(wǎng)站制作營(yíng)銷(xiāo)網(wǎng)站建設(shè)商城網(wǎng)站建設(shè)手機(jī)網(wǎng)站建設(shè)小程序網(wǎng)站建設(shè)網(wǎng)站改版,從內(nèi)容策劃、視覺(jué)設(shè)計(jì)、底層架構(gòu)、網(wǎng)頁(yè)布局、功能開(kāi)發(fā)迭代于一體的高端網(wǎng)站建設(shè)服務(wù)。

具體內(nèi)容如下

正文:

先上效果圖:

微信小程序如何實(shí)現(xiàn)點(diǎn)擊圖片旋轉(zhuǎn)180度并且彈出下拉列表

index.wxml

<view class="phone_one" bindtap="clickPerson">
 <view class="phone_personal">{{firstPerson}}</view>
 <image src="../../image/v6.png" class="personal_image {{selectArea ? 'rotateRight' :''}}"></image> //三目法判斷圖片要不要旋轉(zhuǎn)180。
 </view>
 
<view class="person_box">
 <view class="phone_select" hidden="{{selectPerson}}">
  <view bindtap="mySelect">測(cè)試1</view>
  <view bindtap="mySelect">測(cè)試2</view>
  <view bindtap="mySelect">測(cè)試3</view>
 </view>
</view>

index.js

Page({
 data:{
 selectPerson:true,
 firstPerson:'個(gè)人',
 selectArea:false,
 },
 //點(diǎn)擊選擇類(lèi)型
 clickPerson:function(){
 var selectPerson = this.data.selectPerson;
 if(selectPerson == true){
  this.setData({
  selectArea:true,
  selectPerson:false,
 })
 }else{
  this.setData({
  selectArea:false,
  selectPerson:true,
 })
 }
 } ,
 //點(diǎn)擊切換
 mySelect:function(e){
 this.setData({
  firstPerson:e.target.dataset.me,
  selectPerson:true,
  selectArea:false,
 })
 },
}}

index.wxss

.phone_personal{
 width: 100%;
 color:rgb(34, 154, 181);
 height:100rpx;
 line-height:100rpx;
 text-align: center;
}
.phone_one{
 display: flex; //用flex布局更方便。
 position: relative;
 justify-content: space-between;
 background-color:rgb(239, 239, 239);
 width:90%;
 height:100rpx;
 margin:0 auto;
 border-radius: 10rpx;
 border-bottom:2rpx solid rgb(255, 255, 255);
}
.person_box{
 position: relative;
}
.phone_select{
 margin-top:0;
 z-index: 100;
 position: absolute; //小程序中z-index和absolute需要同時(shí)存在,元素才能脫離文檔。
}
.select_one{
 text-align: center;
 background-color:rgb(239, 239, 239);
 width:676rpx; //脫離文檔后元素width不能再用百分比。
 height:100rpx;
 line-height:100rpx;
 margin:0 5%;
 border-bottom:2rpx solid rgb(255, 255, 255);
}
.personal_image{
 z-index: 100;
 position: absolute;
 right:2.5%;
 width: 34rpx;
 height: 20rpx;
 margin:40rpx 20rpx 40rpx 0;
 transition: All 0.4s ease; 
 -webkit-transition: All 0.4s ease;
}
.rotateRight{
 transform: rotate(180deg); //180°旋轉(zhuǎn)圖片。
}

關(guān)于“微信小程序如何實(shí)現(xiàn)點(diǎn)擊圖片旋轉(zhuǎn)180度并且彈出下拉列表”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。

分享題目:微信小程序如何實(shí)現(xiàn)點(diǎn)擊圖片旋轉(zhuǎn)180度并且彈出下拉列表-創(chuàng)新互聯(lián)
文章網(wǎng)址:http://muchs.cn/article18/dgicgp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、ChatGPT、標(biāo)簽優(yōu)化、商城網(wǎng)站全網(wǎng)營(yíng)銷(xiāo)推廣、云服務(wù)器

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁(yè)設(shè)計(jì)