栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

微信小程序实现音乐播放页面布局

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

微信小程序实现音乐播放页面布局

本文实例为大家分享了微信小程序实现音乐播放页面的布局,供大家参考,具体内容如下

1.效果图如下,点击播放按钮后,光碟转动,播放按钮变为暂停按钮;播放中点击暂停,光碟复位,暂停按钮恢复为播放按钮。

本文仅提供样式布局,其他具体响应不作介绍

2.样式布局代码

wxml:


  
   
  
  
    
    
    
    
    
    
  
  
    
    
    
    
    
  

wxss:

.page_music{
  position: absolute;
  width: 100%;
  height: 80%;
}
.icon{
  position: relative;
  width: 500rpx;
  height: 500rpx;
  top:5%;
  left: 125rpx;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.tools{
  position: relative;
  width: 80%;
  height: 10%;
  top: 10%;
  left: 10%;
}
.last{
  width: 100rpx;
  height: 100rpx;
  position: absolute;
  left: 0;
  top:0;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.play{
  width: 100rpx;
  height: 100rpx;
  position: absolute;
  left: 42%;
  top:0;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.pause{
  width: 100rpx;
  height: 100rpx;
  position: absolute;
  left: 42%;
  top:0;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.next{
  width: 100rpx;
  height: 100rpx;
  position: absolute;
  right: 0;
  top:0;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.volume{
  position: relative;
  width: 80%;
  height: 10%;
  top: 20%;
  left: 10%;
}
.volumeIcon{
  position: absolute;
  left: 0;
  width: 80rpx;
  height: 80rpx;
  top:0;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.sl{
  position: absolute;
  right: 0;
  width: 80%;
  height: 100%;
  top: 0;
  background-image: url(""); 
  background-size: 100% 100%;
  background-repeat:no-repeat;
  background-position: center;
}
.rotateAu{
  animation: rotate 3s linear infinite;
 }
 @keyframes rotate{
  from{transform: rotate(0deg)}
  to{transform: rotate(360deg)}
 }

js:

Page({

  data:{
    isPlay:false,
  },
  play:function(e){
    if(this.data.isPlay==true)
    {
      this.setData({
 isPlay:false
      })
    }
    else
    {
      this.setData({
 isPlay:true
      })
    }
  }
})

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/67410.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号