欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序移動拖拽視圖-movable-view實(shí)例詳解

 更新時間:2019年08月17日 08:43:17   作者:北京智慧流官方iOS博客  
這篇文章主要介紹了微信小程序移動拖拽視圖-movable-view的實(shí)例代碼,代碼簡單易懂,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下

JS中的sender參數(shù)(sender是事件的傳值)前提是只有一個touch移動的時候。多個touch需要在

changedTouches

數(shù)組中查找

 redclcik:function(sender){
  wx.showModal({
   title: '點(diǎn)擊紅色',
   content: '',
  })
  console.log(sender);
 },
 redmove:function(sender){
   console.log(sender);
  // console.log(sender.changedTouches[0].pageX);
  
 },

.wxss內(nèi)容:

<view>移動視圖控件</view>
<!-- 創(chuàng)建一個move-area -->
<movable-area style="width:100%;height:1000rpx;background:gray;">
 <!-- 可以移動view 黃色、寬高100rpx-->
 <movable-view style='background:yellow;width:100rpx;height:100rpx;' direction="all">
 </movable-view>
 <!-- 可以移動view 紅色、寬高100rpx-->
 <movable-view style='background:red;width:100rpx;height:100rpx;' direction="all" bindtap='redclcik' bindtouchmove='redmove'>
 </movable-view>
</movable-area>

視圖效果:

總結(jié)

以上所述是小編給大家介紹的微信小程序移動拖拽視圖-movable-view實(shí)例詳解,希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會及時回復(fù)大家的!

相關(guān)文章

最新評論