Book Image

HTML5 Enterprise Application Development

By : Nehal Shah, Gabriel José Balda Ortíz
Book Image

HTML5 Enterprise Application Development

By: Nehal Shah, Gabriel José Balda Ortíz

Overview of this book

<p>HTML5 has been a trending topic for a long time, but the lack of Flash support on iOS devices has sped up its penetration. New features in HTML5 come at a time when web developers are pushing the limits of what is achievable and HTML5, CSS3, and JavaScript have become an important alternative for building rich user interfaces.<br /><br />"HTML5 Enterprise Application Development" will guide you through the process of building an enterprise application with HTML5, CSS3, and JavaScript through creating a movie finder application. You will learn how to apply HTML5 capabilities in real development problems and how to support consistent user experiences across multiple browsers and operating systems, including mobile platforms.<br /><br />This book will teach you how to build an enterprise application from scratch using HTML5, CSS3, JavaScript, and external APIs.<br /><br />You will discover how to develop engaging experiences using HTML5 capabilities, including video and audio management, location services, and 3D and 2D animations. We will also cover debugging techniques, automated testing, and performance evaluations to give you all the tools needed for an efficient development workflow.<br /><br />"HTML5 Enterprise Application Development" is a comprehensive guide for anyone who wants to build an enterprise web application. You will learn through the implementation of a real-world application as we show you handy libraries, development tips, and development tools.</p>
Table of Contents (20 chapters)
HTML5 Enterprise Application Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preparing our code


We need to add a new interaction to show the ratings chart with a click. Let us remove our current on-click interaction:

$("#movies-near-me li").click(function(){
  $(this).toggleClass("open")
});

The new interaction will include two buttons: one to show the movie description and the other to show the ratings chart. Inside the img folder, you will find an options.png image sprite. It has icons for both information and charts.

Using the details-button and charting-button classes, let us add some styles to styles.css. Each button will be 45 px x 45 px, using absolute positioning to place it in the bottom-right corner:

.details-button,.charting-button{
  width:45px;
  height:45px;
  cursor:pointer;
  position:absolute;
  bottom:10px;
  right:0;
  background:none;
  border:none;
  background-image:url(../img/options.png)
}

Place the details button to the left-hand side of the charting button:

.details-button{
  right:45px;
}

Set the correct image for the charting button:

.charting...