SlideShare ist ein Scribd-Unternehmen logo
1 von 17
CSS3 Transitions
CSS Transitions Introduction




   CSS Transitions allow property changes in CSS values to occur smoothly over a
   specified duration. This smoothing animates the changing of a CSS value when
   triggered by a mouse click, focus or active state, or any changes to the element
   (including even a change on the element’s class attribute).
Basic Rollover


 HTML:

   <a href="#" class="button">Transition me!</a>



 CSS:

  a.button {
     padding: 5px 10px;
     background: #4EBFBF;
     color: #fff;
     text-decoration: none;
    }

  a.button:hover {
         background: #690;
    }
Basic Rollover with Transition


 HTML:

   <a href="#" class="button">Transition me!</a>


 CSS:
  a.button {
     padding: 5px 10px;
     background: #4EBFBF;
     color: #fff;
     text-decoration: none;
     -moz-transition-property: background;
     -moz-transition-duration: 0.3s;
     -moz-transition-timing-function: ease;
    }

  a.button:hover {
         background: #690;
    }
Basic Rollover with Transition




                    background: #4EBFBF;
                    transition-property: background;
                    transition-duration: 0.3s;
                    transition-timing-function: ease;




    transition-property: The property to be transitioned (in this case, the background property)
    transition-duration: How long the transition should last (0.3 seconds)
    transition-timing-function: How fast the transition happens over time (ease)
Timing Function



                        transition-timing-function: ease;


    The timing function value allows the speed of the transition to change over time by
    defining one of six possibilities: ease, linear, ease-in, ease-out, ease-in-out, and cubic-
    bezier (which allows you to define your own timing curve).
Timing Function




       If you slept through geometry in high school like I did, don’t worry. I recommend
       simply plugging in each of these timing function values to see how they differ.

       …For longer animations, the timing function you choose becomes more of an
       important piece of the puzzle, as there’s time to notice the speed changes over the
       length of the animation.

       When in doubt, ease (which is also the default value) or linear should work just fine for
       short transitions.

       - Dan Cederholm
       http://www.alistapart.com/articles/understanding-css3-transitions
Shorthand Code




                 transition-property: background;
                 transition-duration: 0.3s;
                 transition-timing-function: ease;


                              Is the same as:



                 transition: background 0.3s ease;
Browser Compatibility




  The transition property is not supported in any browsers.
  Firefox 4 supports an alternative, the -moz-transition property.
  Safari and Chrome support an alternative, the -webkit-transition property.
  Opera supports an alternative, the -o-transition property.




                -webkit-transition: background 0.3s ease;
                -moz-transition: background 0.3s ease;
                -o-transition: background 0.3s ease;
                transition: background 0.3s ease;
Browser Compatibility
Wouldn’t it make more sense if the transition properties were placed in the :hover declaration,
since that’s the trigger for the transition?

The answer is that there are other possible states of an element besides :hover, and you’ll likely
want that transition to happen on each of those without duplication.

For instance, you may want the transition to also happen on the :focus or :active pseudo-classes
of the link as well. Instead of having to add the transition property stack to each of those
declarations, the transition instructions are attached to the normal state and therefore declared
only once.

- Dan Cederholm
http://www.alistapart.com/articles/understanding-css3-transitions
Transitioning multiple properties



   Let’s say that along with the background color, we also want to change the link’s text color
   and transition that as well. We can do that by stringing multiple transitions together,
   separated by a comma. Each can have their varying duration and timing functions .


       a.button {
       padding: 5px 10px;
       background: #4EBFBF;
       color: #fff;
       -webkit-transition: background .3s ease, color 0.2s linear;
       -moz-transition: background .3s ease, color 0.2s linear;
       -o-transition: background .3s ease, color 0.2s linear;
       transition: background .3s ease, color 0.2s linear;
       }

       a.button:hover, a.button:focus {
       color: #030; background: #690;
       }


                                                    Text via: http://www.alistapart.com/articles/understanding-css3-transitions
Transitioning multiple properties


   An alternative to listing multiple properties is using the all value. This will transition all
   available properties.

   Let’s drop all into our simple example instead of listing background and color separately.
   They’ll now share the same duration and timing function.

                         a.button {
                         padding: 5px 10px;
                         background: #4EBFBF;
                         color: #fff;
                         -webkit-transition: all 0.3s
                         ease;
                         -moz-transition: all 0.3s ease;
                          -o-transition: all 0.3s ease;
                         transition: all 0.3s ease;
                         }

                         a.button:hover, a.button:focus {
                         color: #030; background: #690;
                         }
                                                       Text via: http://www.alistapart.com/articles/understanding-css3-transitions
Example B:


 div.exampletransitionb {               CSS
     width: 520px;
 }
 div.exampletransitionb div {
     background-color: #ED8029;
     border-radius: 5px 5px 5px 5px;
     color: white;
     margin: 5px 0;
     padding: 5px;
     text-align: right;
     width: 100px;
 }
 div.exampletransitionb:hover div {
     width: 500px;
 }
 div.exampletransitionb div.ease {
     -moz-transition: all 3s ease 0s;          <div class="exampletransitionb">
                                                                                                      HTML
 }
 div.exampletransitionb div.linear {
                                               <div   class="ease">ease</div>
     -moz-transition: all 3s linear 0s;
 }
                                               <div   class="linear">linear</div>
 div.exampletransitionb div.easein {           <div   class="easein">ease-in</div>
     -moz-transition: all 3s ease-in 0s;       <div   class="easeout">ease-out</div>
 }                                             <div   class="easeinout">ease-in-out</div>
 div.exampletransitionb div.easeout {
     -moz-transition: all 3s ease-out 0s;      </div>
 }
 div.exampletransitionb div.easeinout {
     -moz-transition: all 3s ease-in-out 0s;
 }                                                      Example via: http://www.css3.info/preview/css3-transitions/
http://leaverou.github.com/animatable/
http://tympanus.net/Tutorials/BlurMenu/index.html
Further Reading




         www.alistapart.com/articles/understanding-css3-transitions
         http://www.w3schools.com/css3/css3_transitions.asp
         http://www.impressivewebs.com/css3-transitions-without-hover
         http://www.netmagazine.com/tutorials/more-efficient-css3-transitions
         http://en.wikipedia.org/wiki/12_basic_principles_of_animation

Weitere ähnliche Inhalte

Andere mochten auch

Capitulo 6
Capitulo 6Capitulo 6
Capitulo 6anari02
 
African Farmer game walkthrough
African Farmer game walkthroughAfrican Farmer game walkthrough
African Farmer game walkthroughfutureagricultures
 
Planning sheets for final piece
Planning sheets for final piecePlanning sheets for final piece
Planning sheets for final pieceaq101824
 
How to pledge for Kickstarter
How to pledge for KickstarterHow to pledge for Kickstarter
How to pledge for KickstarterAlan Rickayzen
 
PS - the delivery of public speaking
PS - the delivery of public speakingPS - the delivery of public speaking
PS - the delivery of public speakingZainal Muttaqin
 
Веда Пульс - для специалистов
Веда Пульс - для специалистовВеда Пульс - для специалистов
Веда Пульс - для специалистовЕлена Шальнова
 
Whitby Seafoods - Office Refurbishment Project
Whitby Seafoods - Office Refurbishment ProjectWhitby Seafoods - Office Refurbishment Project
Whitby Seafoods - Office Refurbishment ProjectNeil Emmott
 
Ukita june 2011pptx
Ukita june 2011pptxUkita june 2011pptx
Ukita june 2011pptxECDStaffsUni
 
Outland res. brochure 6 30-11 brown
Outland res. brochure 6 30-11 brownOutland res. brochure 6 30-11 brown
Outland res. brochure 6 30-11 brownJessica Luth
 
RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA}
RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA} RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA}
RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA} rakesh_srivastava
 
Anexo 12 pc 66707 alimentação (1)
Anexo 12   pc 66707 alimentação (1)Anexo 12   pc 66707 alimentação (1)
Anexo 12 pc 66707 alimentação (1)Miguel Rosario
 
Interactive Reader + Foldable
Interactive Reader  + FoldableInteractive Reader  + Foldable
Interactive Reader + Foldablejmori1
 
Mortgage Backed Securities
Mortgage Backed SecuritiesMortgage Backed Securities
Mortgage Backed SecuritiesClint Hammond
 
Ba759 e70 4b70-45e3-896deb1f6574f53e
Ba759 e70 4b70-45e3-896deb1f6574f53eBa759 e70 4b70-45e3-896deb1f6574f53e
Ba759 e70 4b70-45e3-896deb1f6574f53eCarlos Carvalho
 

Andere mochten auch (20)

affTA04 - BAB IV
affTA04 - BAB IVaffTA04 - BAB IV
affTA04 - BAB IV
 
Capitulo 6
Capitulo 6Capitulo 6
Capitulo 6
 
African Farmer game walkthrough
African Farmer game walkthroughAfrican Farmer game walkthrough
African Farmer game walkthrough
 
Children’s rights
Children’s rightsChildren’s rights
Children’s rights
 
Planning sheets for final piece
Planning sheets for final piecePlanning sheets for final piece
Planning sheets for final piece
 
How to pledge for Kickstarter
How to pledge for KickstarterHow to pledge for Kickstarter
How to pledge for Kickstarter
 
PS - the delivery of public speaking
PS - the delivery of public speakingPS - the delivery of public speaking
PS - the delivery of public speaking
 
Dskp rbt tahun 6
Dskp rbt tahun 6Dskp rbt tahun 6
Dskp rbt tahun 6
 
Веда Пульс - для специалистов
Веда Пульс - для специалистовВеда Пульс - для специалистов
Веда Пульс - для специалистов
 
Whitby Seafoods - Office Refurbishment Project
Whitby Seafoods - Office Refurbishment ProjectWhitby Seafoods - Office Refurbishment Project
Whitby Seafoods - Office Refurbishment Project
 
For (;;)
For (;;)For (;;)
For (;;)
 
Ukita june 2011pptx
Ukita june 2011pptxUkita june 2011pptx
Ukita june 2011pptx
 
Outland res. brochure 6 30-11 brown
Outland res. brochure 6 30-11 brownOutland res. brochure 6 30-11 brown
Outland res. brochure 6 30-11 brown
 
Unit 57 terminology becky doyle
Unit 57 terminology becky doyleUnit 57 terminology becky doyle
Unit 57 terminology becky doyle
 
RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA}
RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA} RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA}
RAJIV GANDHI PR SASHAKTIKARAN YOJANA {RGPSA}
 
Anexo 12 pc 66707 alimentação (1)
Anexo 12   pc 66707 alimentação (1)Anexo 12   pc 66707 alimentação (1)
Anexo 12 pc 66707 alimentação (1)
 
Interactive Reader + Foldable
Interactive Reader  + FoldableInteractive Reader  + Foldable
Interactive Reader + Foldable
 
Mortgage Backed Securities
Mortgage Backed SecuritiesMortgage Backed Securities
Mortgage Backed Securities
 
Ba759 e70 4b70-45e3-896deb1f6574f53e
Ba759 e70 4b70-45e3-896deb1f6574f53eBa759 e70 4b70-45e3-896deb1f6574f53e
Ba759 e70 4b70-45e3-896deb1f6574f53e
 
2011 2012 annual report
2011 2012 annual report2011 2012 annual report
2011 2012 annual report
 

Ähnlich wie CSS3 Transitions

HTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte eventHTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte eventRobert Nyman
 
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichHTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichRobert Nyman
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryAndrea Verlicchi
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsVisual Engineering
 
Dynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsDynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsBeth Soderberg
 
CSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsInayaili León
 
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile EventHTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile EventRobert Nyman
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734pantangmrny
 
Angular js animate shashikant bhongale -20-7-16
Angular js animate shashikant bhongale -20-7-16Angular js animate shashikant bhongale -20-7-16
Angular js animate shashikant bhongale -20-7-16Shashikant Bhongale
 
CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)창석 한
 
Add Some Awesome-Sauce
Add Some Awesome-SauceAdd Some Awesome-Sauce
Add Some Awesome-Saucedavist11
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comapplicake
 
The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)Peter Gasston
 

Ähnlich wie CSS3 Transitions (20)

Css3
Css3Css3
Css3
 
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte eventHTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
 
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichHTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effects
 
Dynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsDynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation Basics
 
CSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and Animations
 
Css3
Css3Css3
Css3
 
CSS3
CSS3CSS3
CSS3
 
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile EventHTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734
 
Css3
Css3Css3
Css3
 
CSS 3 Overview
CSS 3 OverviewCSS 3 Overview
CSS 3 Overview
 
Angular js animate shashikant bhongale -20-7-16
Angular js animate shashikant bhongale -20-7-16Angular js animate shashikant bhongale -20-7-16
Angular js animate shashikant bhongale -20-7-16
 
CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)
 
DotNetNuke World CSS3
DotNetNuke World CSS3DotNetNuke World CSS3
DotNetNuke World CSS3
 
Add Some Awesome-Sauce
Add Some Awesome-SauceAdd Some Awesome-Sauce
Add Some Awesome-Sauce
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
 
The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)
 

Mehr von hstryk

CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2hstryk
 
Lesson1 - Fall 2013
Lesson1 - Fall 2013Lesson1 - Fall 2013
Lesson1 - Fall 2013hstryk
 
Lesson2
Lesson2Lesson2
Lesson2hstryk
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3hstryk
 
Sprites rollovers
Sprites rolloversSprites rollovers
Sprites rollovershstryk
 
Building a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSSBuilding a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSShstryk
 
Lecture4
Lecture4Lecture4
Lecture4hstryk
 
Tutorial1 - Part 2
Tutorial1 - Part 2Tutorial1 - Part 2
Tutorial1 - Part 2hstryk
 
Tutorial1
Tutorial1Tutorial1
Tutorial1hstryk
 
Project1
Project1Project1
Project1hstryk
 
Lesson 3
Lesson 3Lesson 3
Lesson 3hstryk
 
Lesson2
Lesson2Lesson2
Lesson2hstryk
 
Lesson1
Lesson1Lesson1
Lesson1hstryk
 
Heather Strycharz - Resume
Heather Strycharz - ResumeHeather Strycharz - Resume
Heather Strycharz - Resumehstryk
 

Mehr von hstryk (16)

CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2Lesson 3 - HTML & CSS Part 2
Lesson 3 - HTML & CSS Part 2
 
Lesson1 - Fall 2013
Lesson1 - Fall 2013Lesson1 - Fall 2013
Lesson1 - Fall 2013
 
Lesson2
Lesson2Lesson2
Lesson2
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Sprites rollovers
Sprites rolloversSprites rollovers
Sprites rollovers
 
Building a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSSBuilding a Website from Planning to Photoshop Mockup to HTML/CSS
Building a Website from Planning to Photoshop Mockup to HTML/CSS
 
Lecture4
Lecture4Lecture4
Lecture4
 
Tutorial1 - Part 2
Tutorial1 - Part 2Tutorial1 - Part 2
Tutorial1 - Part 2
 
Tutorial1
Tutorial1Tutorial1
Tutorial1
 
Project1
Project1Project1
Project1
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Lesson2
Lesson2Lesson2
Lesson2
 
Lesson1
Lesson1Lesson1
Lesson1
 
Heather Strycharz - Resume
Heather Strycharz - ResumeHeather Strycharz - Resume
Heather Strycharz - Resume
 

Kürzlich hochgeladen

NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...Amil baba
 
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime PondicherryPondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherrymeghakumariji156
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证wpkuukw
 
BLOCK CHAIN PROJECT block chain project
BLOCK CHAIN  PROJECT block chain projectBLOCK CHAIN  PROJECT block chain project
BLOCK CHAIN PROJECT block chain projectujraj8767
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationZenSeloveres
 
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样yhavx
 
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证ehyxf
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxbingyichin04
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证eqaqen
 
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证eeanqy
 
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...nirzagarg
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024Ilham Brata
 
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service AvailableCall Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service AvailableNitya salvi
 
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
Minimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptxMinimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptxbalqisyamutia
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahimamgadibrahim92
 
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Nitya salvi
 
LANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEK
LANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEKLANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEK
LANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEKMarekMitek1
 
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...samsungultra782445
 
poliovirus-190801072449. pptx
poliovirus-190801072449.            pptxpoliovirus-190801072449.            pptx
poliovirus-190801072449. pptxssuser0ad194
 

Kürzlich hochgeladen (20)

NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
 
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime PondicherryPondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
 
BLOCK CHAIN PROJECT block chain project
BLOCK CHAIN  PROJECT block chain projectBLOCK CHAIN  PROJECT block chain project
BLOCK CHAIN PROJECT block chain project
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
 
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
 
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
 
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
Top profile Call Girls In Mau [ 7014168258 ] Call Me For Genuine Models We ar...
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024
 
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service AvailableCall Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
Call Girls Jalaun Just Call 8617370543 Top Class Call Girl Service Available
 
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
 
Minimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptxMinimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptx
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahim
 
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
 
LANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEK
LANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEKLANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEK
LANDSCAPE ARCHITECTURE PORTFOLIO - MAREK MITACEK
 
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
 
poliovirus-190801072449. pptx
poliovirus-190801072449.            pptxpoliovirus-190801072449.            pptx
poliovirus-190801072449. pptx
 

CSS3 Transitions

  • 2. CSS Transitions Introduction CSS Transitions allow property changes in CSS values to occur smoothly over a specified duration. This smoothing animates the changing of a CSS value when triggered by a mouse click, focus or active state, or any changes to the element (including even a change on the element’s class attribute).
  • 3. Basic Rollover HTML: <a href="#" class="button">Transition me!</a> CSS: a.button { padding: 5px 10px; background: #4EBFBF; color: #fff; text-decoration: none; } a.button:hover { background: #690; }
  • 4. Basic Rollover with Transition HTML: <a href="#" class="button">Transition me!</a> CSS: a.button { padding: 5px 10px; background: #4EBFBF; color: #fff; text-decoration: none; -moz-transition-property: background; -moz-transition-duration: 0.3s; -moz-transition-timing-function: ease; } a.button:hover { background: #690; }
  • 5. Basic Rollover with Transition background: #4EBFBF; transition-property: background; transition-duration: 0.3s; transition-timing-function: ease; transition-property: The property to be transitioned (in this case, the background property) transition-duration: How long the transition should last (0.3 seconds) transition-timing-function: How fast the transition happens over time (ease)
  • 6. Timing Function transition-timing-function: ease; The timing function value allows the speed of the transition to change over time by defining one of six possibilities: ease, linear, ease-in, ease-out, ease-in-out, and cubic- bezier (which allows you to define your own timing curve).
  • 7. Timing Function If you slept through geometry in high school like I did, don’t worry. I recommend simply plugging in each of these timing function values to see how they differ. …For longer animations, the timing function you choose becomes more of an important piece of the puzzle, as there’s time to notice the speed changes over the length of the animation. When in doubt, ease (which is also the default value) or linear should work just fine for short transitions. - Dan Cederholm http://www.alistapart.com/articles/understanding-css3-transitions
  • 8. Shorthand Code transition-property: background; transition-duration: 0.3s; transition-timing-function: ease; Is the same as: transition: background 0.3s ease;
  • 9. Browser Compatibility The transition property is not supported in any browsers. Firefox 4 supports an alternative, the -moz-transition property. Safari and Chrome support an alternative, the -webkit-transition property. Opera supports an alternative, the -o-transition property. -webkit-transition: background 0.3s ease; -moz-transition: background 0.3s ease; -o-transition: background 0.3s ease; transition: background 0.3s ease;
  • 11. Wouldn’t it make more sense if the transition properties were placed in the :hover declaration, since that’s the trigger for the transition? The answer is that there are other possible states of an element besides :hover, and you’ll likely want that transition to happen on each of those without duplication. For instance, you may want the transition to also happen on the :focus or :active pseudo-classes of the link as well. Instead of having to add the transition property stack to each of those declarations, the transition instructions are attached to the normal state and therefore declared only once. - Dan Cederholm http://www.alistapart.com/articles/understanding-css3-transitions
  • 12. Transitioning multiple properties Let’s say that along with the background color, we also want to change the link’s text color and transition that as well. We can do that by stringing multiple transitions together, separated by a comma. Each can have their varying duration and timing functions . a.button { padding: 5px 10px; background: #4EBFBF; color: #fff; -webkit-transition: background .3s ease, color 0.2s linear; -moz-transition: background .3s ease, color 0.2s linear; -o-transition: background .3s ease, color 0.2s linear; transition: background .3s ease, color 0.2s linear; } a.button:hover, a.button:focus { color: #030; background: #690; } Text via: http://www.alistapart.com/articles/understanding-css3-transitions
  • 13. Transitioning multiple properties An alternative to listing multiple properties is using the all value. This will transition all available properties. Let’s drop all into our simple example instead of listing background and color separately. They’ll now share the same duration and timing function. a.button { padding: 5px 10px; background: #4EBFBF; color: #fff; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease; } a.button:hover, a.button:focus { color: #030; background: #690; } Text via: http://www.alistapart.com/articles/understanding-css3-transitions
  • 14. Example B: div.exampletransitionb { CSS width: 520px; } div.exampletransitionb div { background-color: #ED8029; border-radius: 5px 5px 5px 5px; color: white; margin: 5px 0; padding: 5px; text-align: right; width: 100px; } div.exampletransitionb:hover div { width: 500px; } div.exampletransitionb div.ease { -moz-transition: all 3s ease 0s; <div class="exampletransitionb"> HTML } div.exampletransitionb div.linear { <div class="ease">ease</div> -moz-transition: all 3s linear 0s; } <div class="linear">linear</div> div.exampletransitionb div.easein { <div class="easein">ease-in</div> -moz-transition: all 3s ease-in 0s; <div class="easeout">ease-out</div> } <div class="easeinout">ease-in-out</div> div.exampletransitionb div.easeout { -moz-transition: all 3s ease-out 0s; </div> } div.exampletransitionb div.easeinout { -moz-transition: all 3s ease-in-out 0s; } Example via: http://www.css3.info/preview/css3-transitions/
  • 17. Further Reading www.alistapart.com/articles/understanding-css3-transitions http://www.w3schools.com/css3/css3_transitions.asp http://www.impressivewebs.com/css3-transitions-without-hover http://www.netmagazine.com/tutorials/more-efficient-css3-transitions http://en.wikipedia.org/wiki/12_basic_principles_of_animation