Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts
0

HTML 5 NEW INPUT TYPES

Posted by Nantharupan on 1:26 AM in , ,
HTML 5 added a lot of new input types. We can do the validation easily with the newly added features.

Newly added input types are follows
  1. url
  2. tel
  3. number
  4. email
  5. color
  6. date
  7. datetime
  8. datetime-local
  9. month
  10. range
  11. search
  12. time
  13. week

Some Examples

Color : 
HTML Code
<input  type="color" />

Favorite Color:

Date :
HTML Code
<input type="date" />

Date of Birth:

Number :
HTML Code
<input type="number" name="quantity" min="1" max="5">

Age :

















0

Stop Phone Gap Android Application Crash when orientation Changes

Posted by Nantharupan on 9:57 PM in , ,
Problem

PhoneGap Android Application crashes when orientation changes

Solution 

Some changes need to be done in the AndroidMainfest.xml file 

Put the following to the Main activity or all the activity you have

android:configChanges="orientation|screenSize|keyboardHidden" 





0

Fixing Header and Footer & Scroll able Content

Posted by Nantharupan on 10:18 PM in , ,
Today i found a simple way to fix the Header and Footer of the HTML page to top and bottom respectively and make the content scroll able, it will be useful when we have list of items and fixed header & footer in mobile applications. 

Here is the HTML you have to use






Here is the CSS you have to use.





0

HTML5 Storage

Posted by Nantharupan on 11:12 PM in ,
HTML5 Storage

HTML5 included two mechanism to store user data in client side. 


  1. session storage
  2. local storage

Session Storage

The session storage is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transaction in different window at the same time.
  • How to store the values
<script type="text/javascript">
sessionStorage.star = 1;
</script>
  • How to retrieve the values
<script type="text/javascript">
document.write("Total star Earned " +sessionStorage.star);
</script>

  • How to clear sessionstorage
    • Session storage will be cleared when browser closed
Local Storage

The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session.
  • How to store the values
<script type="text/javascript">
localStorage.star = 1;
</script>

  • How to retrieve the values
<script type="text/javascript">
document.write("Total star Earned " + localStorage .star);
</script>
  • How to clear localStorage
localstorage.clear(); will clear all local storage;
or
localStorage.remove("key"); will remove particular key
<script type="text/javascript">
localStorage.clear();
</script>

Popular posts

Copyright © 2009 On the way All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.