CSS3 Transition, HTML5 audio

Source: Internet
Author: User

Free to practice practiced hand, materials from the "Html5+css3+jquery application of the United States"

The book is too long-winded, the code used to do an effect,

Demo download

Relatively simple, don't wordy, stick to the main code and jquery

. Banner{width:728px;Height:176px;Display:Block;margin:40px Auto;Border:1px solid #333;position:relative;background:URL (.. /images/banner-arrow.png) 20px 190px no-repeat, url (.. /images/banner-photo.png) -10px 190px no-repeat, url (.. /images/banner-09.png) 20px-354px no-repeat, url (.. /images/banner-bg.png) left top no-repeat;transition:All 0.2s ease-in 0.2s;-moz-transition:All 0.2s ease-in 0.2s;-webkit-transition:All 0.2s ease-in 0.2s;-o-transition:All 0.2s ease-in 0.2s;}. Banner:hover{background-position:20px 90%, -10px 20px, 20px Center, left top;}. Banner-logo{position:Absolute;Top:21px; Left:210px;transition:All 0.2s ease-in 0.2s;-moz-transition:All 0.2s ease-in 0.2s;-webkit-transition:All 0.2s ease-in 0.2s;-o-transition:All 0.2s ease-in 0.2s;}. Banner:hover. Banner-logo{ Left:540px;}
    varBanner_audio =NewAudio (); varWEBM =ISSUPPORTWEBM (); if(WEBM) {banner_audio.src= ' MEDIA/BANNER_SOUND.WEBM '; }    Else{banner_audio.src= ' Media/banner_sound.mp3 '    }            $('. Banner '). MouseEnter (function() {banner_audio.load ();    Banner_audio.play ();    }); $('. Banner '). MouseLeave (function() {banner_audio.pause ();    }); functionISSUPPORTWEBM () {varTester = document.createelement (' Audio '); returnTester.canplaytype (' AUDIO/WEBM '); }

CSS3 Transition, HTML5 audio

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.