网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網(wǎng)

微信小程序?qū)崿F(xiàn)點(diǎn)擊圖片旋轉(zhuǎn)180度并且彈出下拉列表

發(fā)布時(shí)間:2018-01-02 08:52 所屬欄目:小程序開發(fā)教程

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

 
 
 
 

//index.wxml

 

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

//index.js

 

			
  1. <pre name="code" class="html">Page({
  2. data:{
  3. selectPerson:true,
  4. firstPerson:'個(gè)人',
  5. selectArea:false,
  6. },
  7. //點(diǎn)擊選擇類型
  8. clickPerson:function(){
  9. var selectPerson = this.data.selectPerson;
  10. if(selectPerson == true){
  11. this.setData({
  12. selectArea:true,
  13. selectPerson:false,
  14. })
  15. }else{
  16. this.setData({
  17. selectArea:false,
  18. selectPerson:true,
  19. })
  20. }
  21. } ,
  22. //點(diǎn)擊切換
  23. mySelect:function(e){
  24. this.setData({
  25. firstPerson:e.target.dataset.me,
  26. selectPerson:true,
  27. selectArea:false,
  28. })
  29. },
  30. }}</pre><pre name="code" class="html"></pre>//index.wxss
  31. [html] view plain copy
  32. <pre name="code" class="html">.phone_personal{
  33. width: 100%;
  34. color:rgb(34, 154, 181);
  35. height:100rpx;
  36. line-height:100rpx;
  37. text-align: center;
  38. }
  39. .phone_one{
  40. display: flex; //用flex布局更方便。
  41. position: relative;
  42. justify-content: space-between;
  43. background-color:rgb(239, 239, 239);
  44. width:90%;
  45. height:100rpx;
  46. margin:0 auto;
  47. border-radius: 10rpx;
  48. border-bottom:2rpx solid rgb(255, 255, 255);
  49. }
  50. .person_box{
  51. position: relative;
  52. }
  53. .phone_select{
  54. margin-top:0;
  55. z-index: 100;
  56. position: absolute; //小程序中z-index和absolute需要同時(shí)存在,元素才能脫離文檔。
  57. }
  58. .select_one{
  59. text-align: center;
  60. background-color:rgb(239, 239, 239);
  61. width:676rpx; //脫離文檔后元素width不能再用百分比。
  62. height:100rpx;
  63. line-height:100rpx;
  64. margin:0 5%;
  65. border-bottom:2rpx solid rgb(255, 255, 255);
  66. }
  67. .personal_image{
  68. z-index: 100;
  69. position: absolute;
  70. right:2.5%;
  71. width: 34rpx;
  72. height: 20rpx;
  73. margin:40rpx 20rpx 40rpx 0;
  74. transition: All 0.4s ease;
  75. -webkit-transition: All 0.4s ease;
  76. }
  77. .rotateRight{
  78. transform: rotate(180deg); //180°旋轉(zhuǎn)圖片。
  79. }</pre>
  80. <p></p><pre name="code" class="html" style="font-size: 13.3333px;"></pre><p></p>
  81. <pre></pre>


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/18334.html 復(fù)制鏈接 如需定制請(qǐng)聯(lián)系易優(yōu)客服咨詢:800182392 點(diǎn)擊咨詢
QQ在線咨詢
AI智能客服 ×