HTML5 + CSS3 + jquery implements a simple music player, html5css3

Source: Internet
Author: User

HTML5 + CSS3 + jquery implements a simple music player, html5css3

... It's like a pancake... When others put their sisters, only the programmers who are forced to write code over there... My day!

Then today, I wrote a player in my early years... Does it look quite appealing! Lisa sang an episode at angel beats.

Finally, before explaining how to write this thing, I am a 24-year-old man from Shanghai. I am looking for a girlfriend and asked for a gentle personality... (Omitted 500 words)

<Div class = "Music"> <div class = "MusicPlaySound">   <div class =" MusicPlayBox "> 

The html part is skipped .... It can basically be written...

.MusicPlayProcess.rotate{animation:rotate 30s infinite linear;}.MusicPlayProcess.pause{animation-play-state:paused;-webkit-animation-play-state:paused;}.MusicPicName.PicNameRotate{animation:rotate 4s infinite linear;}.MusicPicName.pause{animation-play-state:paused;-webkit-animation-play-state:paused;}@keyframes rotate{    from{ transform:rotate(0deg)}    to{ transform:rotate(360deg)}}

Css is mainly interesting.

About a few css3 animations .... The above. MusicPlayProcess. rotate {animation: rotate 30 s infinite linear ;}

You can change this 30 s to the length of the song to a progress bar ~ HOHOHOHO)

Infinite unlimited playback, you know.

. MusicPicName. pause {animation-play-state: paused;-webkit-animation-play-state: paused ;}
Then pause the animation ,,,,

Compatibility is tough. Nothing else.

$(function(){    var play=1;    $(".MusicPicButton").click(function(){        if(play==0){            $(this).attr("src","image/music/pause.png")            $(".MusicPlayProcess").removeClass("pause")            $(".MusicPicName").removeClass("pause")                $("audio").get(0).play();            play=1;        }else{            $(this).attr("src","image/music/play.png")            $(".MusicPlayProcess").addClass("pause")            $(".MusicPicName").addClass("pause")                play=0;            $("audio").get(0).pause();        }            })    })

Here is the Jq Section

Play? OK Current Status 1 play 0 pause

 $("audio").get(0).play();
$ ("Audio"). get (0). pause ();

Play... Pause...



Last demo

Http://xiaobai.52nhw.com/music.html

 

 

 

Then the point is, I am facing the loss of T_T, and beg for easy pitfalls. The target salary is over RMB. Three years of front-end development experience and two years of html5 mobile development experience, phonegap, and code preparation. Optimistic personality, willing to learn new things (let's watch which is fun, and now we are playing games !)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.