SlideShare a Scribd company logo
CSS3 vs. jQuery
Prak Sophy (@psophy)
www.web-essentials.asia
www.typo3cambodia.org
CSS3?
 CSS3 contains just about everything that’s included in
 CSS2.1
 2000-04-14 First Public Draft
  2001-01-19 Working Draft
 Current Working Draft
jQuery?
 An open source JavaScript library
 Created by John Resig in 2005 
 Release in January 14th, 2006 at BarCampNYC
 Current Version jQuery v1.6.4
Selectors
CSS3:
  :first-child     :empty
  :last-child      :target
  :nth-child(n)    :enable
  :nth-of-type     :display
  :first-of-type   :not(S)
  :last-of-type    ::first-line
  :only-child      ::first-letter
  :only-of-type    ...
  :root
  :empty
Selectors...

jQuery:
  :button,
  :even
  :empty
  :first-child
  :gt
  :has
  :last-child
  :parent
  ...
HTML
   <ul class="menu">
      <li><a href="/a/1">Menu</a>
          <ul>
              <li><a href="/a/a">Sub-menu   A</a></li>
              <li><a href="/a/b">Sub-menu   B</a></li>
              <li><a href="/a/c">Sub-menu   C</a></li>
          </ul>
      </li>
  </ul>
CSS3
      .menu > li > ul {
         display: none;
      }
      .menu > li:hover > ul {
          display: block;
       }
jQuery

$('.menu > li').hover(
  function(){
      $('ul', this).show('slow');
  },
  function(){
      $('ul', this).hide('slow');
  }
);
:nth-child
CSS3
.student-list tbody tr:nth-child(2n) {
   background: #7CEAE1;
 }
 .student-list tbody tr:nth-child(2n + 1) {
   background: #fcfcfc;
 }

 Or...
.student-list tbody tr:nth-child(odd) {
   background: #7CEAE1;
 }
 .student-list tbody tr:nth-child(even) {
   background: #fcfcfc;
 }
jQuery
$(".student-list tbody tr:odd").css('background', '#7CEAE1');
$(".student-list tbody tr:even").css('background', '#f5f5f5');




Or..

$(".student-list tbody tr:nth-child(2n)").css('background',
'#7CEAE1');

$(".student-list tbody tr:nth-child(2n+1)").css('background',
'#f5f5f5');
FORM VALIDATION
jQuery Validate Engine
https://github.com/posabsolute/jQuery-Validation-Engine
HTML
<input value="2010-12-01"
class="validate[required,custom[date]]"
type="text" name="date" id="date" />

<input value="too"
class="validate[required,custom[onlyLet
terNumber]]" type="text" name="special"
id="special" />
jQuery
$("#form.id").validationEngine();


//Demo   http://www.position-relative.net/creation/formValidator/
Using CSS3 and HTML5
 /* A List Apart: Forward Thinking Form Validation (http://goo.gl/7d5yQ) */
CSS3 UI pseudo-class
:valid
:invalid
:required
:optional
:out-of-range
:read-only
:read-write
HTML
…

<label for="email">Email *</label>
<input type="email" id="email" name="email"
   placeholder="e.g. ryan@example.net"
   title="Please enter a valid email" required />
   <p class="validation01">
     <span class="invalid">Please enter a valid
      email address e.g. ryan@example.com</span>
     <span class="valid">Thank you for entering a
      valid email</span>
   </p>

…
CSS3
.validation01 {
  background: red;
  color: #fff;
  display: none;
  font-size: 12px;
  padding: 3px;
  position: absolute;
  right: -110px;
  text-align: center;
  top: 0;
  width: 100px;
}
CSS3
input:focus + .validation01 {
  display: block;
}

input:focus:required:valid + .validation01 {
  background: green;
}

input:focus:required:valid + .validation01 .invalid
{
  display: none;
}

input:focus:required:invalid + .validation01 .valid
{
  display: none;
}
ANIMATION
jQuery Animation
       Methods
.animate()      .slideDown
.fadeIn()       .slideToggle()
.fadeOut()      .slideUp
.fadeToggle()   .stop()
.fadeTo()       .toggle()
.hide()
.show()
jQuery Animate
$("#example_box").animate({
    width: "70%",
    opacity: 0.4,
    marginLeft: "0.6in",
    fontSize: "3em",
    borderWidth: "10px"
  }, 1500 );
CSS3 Transitions
transition-property: background;
transition-duration: 0.3s;
transition-timing-function: ease;




/* Don't forget vendors prefix */
-moz-transition
-webkit-transition
-o-transition
CSS3 Transitions
/* Shortcut */
transition: background 0.3s ease;
/* Multiple properties */
transition: background 0.3s ease,
            width 0.3s linear;
/* All properties */
transition: all 0.3s ease;
/* Understanding CSS3 Transitions */
http://goo.gl/k9EcX
/* Transition with Tranform */
http://goo.gl/HB2mc
http://goo.gl/KvclU
CSS3 Transform


    http://goo.gl/QZvVw




        http://goo.gl/xL2yv
CSS3 Transform
transform: translate(100px, 100px);




/* Don't forget vendors prefix */
-moz-transform
-webkit-transform
-o-transform
CSS3 Transform
transform: translate(80px, 80px)
  scale(1.5, 1.5) rotate(45deg);
CSS3 Animation(@)




 http://goo.gl/c8QJB   http://goo.gl/uv33G
CSS3 Animation
.   The Keyframe @ Rule
.   animation-name
.   animation-duration
.   animation-timing-function
.   animation-iteration-count
.   animation-direction
.   animation-delay
CSS3 Animation
@keyframes resize {
   0% {
        padding: 0;
   }
   50% {
     padding: 0 20px;
     background-color:rgba(255,0,0,0.2);
   }
   100% {
      padding: 0 100px;
      background-color:rgba(255,0,0,0.9);
   }
}
CSS3 Animation
#box {
   animation-name: resize;
   animation-duration: 1s;
   animation-iteration-count: 4;
   animation-direction: alternate;
   animation-timing-function: ease-in-out;
}
/* Don't forget vendors prefix */
-moz-transition
-webkit-transition
-o-transition
TAG TEAM: jQuery with CSS3
http://jquerymobile.com/
CSS3 and jQuery
THANK YOU!
 http://kooms.info

More Related Content

What's hot (20)

PPTX
jQuery from the very beginning
Anis Ahmad
 
PPTX
Java script errors &amp; exceptions handling
AbhishekMondal42
 
PDF
Jquery for post a form
Rakesh Kumar
 
KEY
Who Needs Ruby When You've Got CodeIgniter
ciconf
 
PDF
Pengenalan AngularJS
Edi Santoso
 
PDF
Intro to jquery
Dan Pickett
 
PDF
HTML5 - The 2012 of the Web
Robert Nyman
 
PPTX
Component lifecycle hooks in Angular 2.0
Eyal Vardi
 
PDF
Angular js - 4developers 12 kwietnia 2013
Marcin Wosinek
 
PDF
Friendlier, Safer WordPress Admin Areas
Cliff Seal
 
PDF
Web-First Design Patterns
Michael Mahemoff
 
PDF
次世代版 PowerCMS 開発プロジェクトのご紹介
純生 野田
 
PDF
PowerCMS X
純生 野田
 
PDF
Jquery In Rails
shen liu
 
PDF
Introducing jQuery
Wildan Maulana
 
PPTX
AngularJS Compile Process
Eyal Vardi
 
PPTX
Oh, you’re the NY times guy
David Hayes
 
PPTX
AngulrJS Overview
Eyal Vardi
 
PDF
Css selectors
Михаил Петров
 
PDF
Theming Ext JS 4
Sencha
 
jQuery from the very beginning
Anis Ahmad
 
Java script errors &amp; exceptions handling
AbhishekMondal42
 
Jquery for post a form
Rakesh Kumar
 
Who Needs Ruby When You've Got CodeIgniter
ciconf
 
Pengenalan AngularJS
Edi Santoso
 
Intro to jquery
Dan Pickett
 
HTML5 - The 2012 of the Web
Robert Nyman
 
Component lifecycle hooks in Angular 2.0
Eyal Vardi
 
Angular js - 4developers 12 kwietnia 2013
Marcin Wosinek
 
Friendlier, Safer WordPress Admin Areas
Cliff Seal
 
Web-First Design Patterns
Michael Mahemoff
 
次世代版 PowerCMS 開発プロジェクトのご紹介
純生 野田
 
PowerCMS X
純生 野田
 
Jquery In Rails
shen liu
 
Introducing jQuery
Wildan Maulana
 
AngularJS Compile Process
Eyal Vardi
 
Oh, you’re the NY times guy
David Hayes
 
AngulrJS Overview
Eyal Vardi
 
Theming Ext JS 4
Sencha
 

Viewers also liked (12)

PDF
Responsive Web Design On Student's day
psophy
 
PPTX
Php framework at BarCampPP
psophy
 
PDF
Mobile web and j query mobile
psophy
 
PDF
CSS3 and Selectors
Rachel Andrew
 
PPTX
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
PDF
Modul HTML5
As Faizin
 
PDF
Quality Development with CSS3
Shay Howe
 
PPTX
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
Todd Anglin
 
PDF
Fundamental CSS3
Achmad Solichin
 
PDF
Fundamental HTML5
Achmad Solichin
 
PDF
Up to Speed on HTML 5 and CSS 3
M. Jackson Wilkinson
 
PPT
Introduction to HTML
MayaLisa
 
Responsive Web Design On Student's day
psophy
 
Php framework at BarCampPP
psophy
 
Mobile web and j query mobile
psophy
 
CSS3 and Selectors
Rachel Andrew
 
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
Modul HTML5
As Faizin
 
Quality Development with CSS3
Shay Howe
 
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
Todd Anglin
 
Fundamental CSS3
Achmad Solichin
 
Fundamental HTML5
Achmad Solichin
 
Up to Speed on HTML 5 and CSS 3
M. Jackson Wilkinson
 
Introduction to HTML
MayaLisa
 
Ad

Similar to CSS3 and jQuery (20)

PDF
Using jQuery to Extend CSS
Chris Coyier
 
KEY
CSS3 Takes on the World
Jonathan Snook
 
KEY
HTML5, CSS3, and other fancy buzzwords
Mo Jangda
 
PDF
Accelerated Stylesheets
Wynn Netherland
 
ODP
Introduction of Html/css/js
Knoldus Inc.
 
PDF
DotNetNuke World CSS3
gravityworksdd
 
PDF
jQuery Loves Developers - Oredev 2009
Remy Sharp
 
PDF
Big Design Conference: CSS3
Wynn Netherland
 
PPTX
Jquery
PaRa Vaishnav
 
PPTX
CSS 3 Overview
Danilo Sousa
 
PDF
Intro to CSS3
Denise Jacobs
 
PDF
Implementing Awesome: An HTML5/CSS3 Workshop
Shoshi Roberts
 
PDF
CSS3 Talk (PDF version)
Robyn Overstreet
 
PDF
CSS3 Talk at SF HTML5 Meetup
Robyn Overstreet
 
PDF
Html standards presentation
Tiago Cardoso
 
PDF
Write Less Do More
Remy Sharp
 
PDF
jQuery for beginners
Siva Arunachalam
 
PPTX
Css3
Anjan Banda
 
KEY
Core CSS3
Rachel Andrew
 
PDF
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
Robert Nyman
 
Using jQuery to Extend CSS
Chris Coyier
 
CSS3 Takes on the World
Jonathan Snook
 
HTML5, CSS3, and other fancy buzzwords
Mo Jangda
 
Accelerated Stylesheets
Wynn Netherland
 
Introduction of Html/css/js
Knoldus Inc.
 
DotNetNuke World CSS3
gravityworksdd
 
jQuery Loves Developers - Oredev 2009
Remy Sharp
 
Big Design Conference: CSS3
Wynn Netherland
 
CSS 3 Overview
Danilo Sousa
 
Intro to CSS3
Denise Jacobs
 
Implementing Awesome: An HTML5/CSS3 Workshop
Shoshi Roberts
 
CSS3 Talk (PDF version)
Robyn Overstreet
 
CSS3 Talk at SF HTML5 Meetup
Robyn Overstreet
 
Html standards presentation
Tiago Cardoso
 
Write Less Do More
Remy Sharp
 
jQuery for beginners
Siva Arunachalam
 
Core CSS3
Rachel Andrew
 
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
Robert Nyman
 
Ad

Recently uploaded (20)

PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 

CSS3 and jQuery