Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
HTML5 and CSS3: Building Responsive Websites

You're reading from   HTML5 and CSS3: Building Responsive Websites One-stop guide for Responsive Web Design

Arrow left icon
Product type Course
Published in Oct 2016
Publisher Packt
ISBN-13 9781787124813
Length 709 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Ben Frain Ben Frain
Author Profile Icon Ben Frain
Ben Frain
Benjamin LaGrone Benjamin LaGrone
Author Profile Icon Benjamin LaGrone
Benjamin LaGrone
Thoriq Firdaus Thoriq Firdaus
Author Profile Icon Thoriq Firdaus
Thoriq Firdaus
Arrow right icon
View More author details
Toc

Chapter 7. Unobtrusive JavaScript

In this chapter you will learn:

  • Writing "Hello World" unobtrusively
  • Creating a glowing "submit" button with the event listener
  • Making a button stand out when you hover over it
  • Resizing an element with unobtrusive jQuery
  • Masking a password with unobtrusive JavaScript
  • Using an event listener to animate an image shadow

Introduction

The concept of unobtrusive JavaScript fits right into responsive design. By keeping your interaction layer at an arm's length from your presentation layer, you can build a great degree of flexibility into your web app. Because mobile devices have very different input methods, you may need to call a function through a different event. You may want to create a desktop version of a page with JavaScript and use jQuery Mobile instead for your mobile version; with the same template files, by using unobtrusive JavaScript, this is not a difficult task.

Writing "Hello World" unobtrusively

An important...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image