Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML5 Demo ISYS 350. HTML 5 validation/#.UdytIOLn_zc validation/#.UdytIOLn_zc.

Similar presentations


Presentation on theme: "HTML5 Demo ISYS 350. HTML 5 validation/#.UdytIOLn_zc validation/#.UdytIOLn_zc."— Presentation transcript:

1 HTML5 Demo ISYS 350

2 HTML 5 http://www.the-art-of-web.com/html/html5-form- validation/#.UdytIOLn_zc http://www.the-art-of-web.com/html/html5-form- validation/#.UdytIOLn_zc http://diveintohtml5.info/forms.html http://24ways.org/2009/have-a-field-day-with-html5-forms/ http://www.w3.org/TR/html5/forms.html

3 New INPUT types http://www.w3schools.com/html/html_form_input_types.asp INPUT type="number" INPUT type="range” Other types: – email, url, tel, etc Age: Satisfaction:

4 'required' attribute Example: Your Name:

5 ‘placeholder’ Attribute Placeholder attribute which lets us display a prompt or instructions inside the field. Example: Email Address:

6 HTML 5 Form Demo Your Name: Email Address: Website: Age: Satisfaction:

7 HTML 5 Form fieldset https://24ways.org/2009/have-a-field-day-with-html5-forms/ – Like a GroupBox – http://www.w3schools.com/tags/tag_fieldset.asp http://www.w3schools.com/tags/tag_fieldset.asp – Try It Yourself

8 Is there any way to have a fieldset width only be as wide as the controls in them? display: inline-block – inline-block elements are like inline elements but they can have a width and a height..floating-box { display: inline-block; width: 170px; height: 175px; margin: 10px; border: 3px solid blue; } Example:http://stackoverflow.com/questions/2302495/is- there-any-way-to-have-a-fieldset-width-only-be-as-wide-as- the-controls-in-the

9 HTML5 Multimedia: Video,Audio,Youtube,Etc. http://www.w3schools.com/html/html_media.asp http://www.w3schools.com/html/html_media.asp

10 Adding New Elements to HTML http://www.w3schools.com/html/html5_browsers.asp Creating an HTML Element document.createElement("myHero") myHero { display: block; background-color: #ddd; padding: 50px; font-size: 30px; } My First Hero

11 HTML5 Geolocation http://www.w3schools.com/html/html5_geolocation.asp The navigator.geolocation.getCurrentPosition() method returns an object with latitude, longitude and other properties. Latitude Logitude Static map

12 HTML5 Geolocation Demo var x; function getLocation() { x = document.getElementById("demo"); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude; } Click the button to get your coordinates. Try It

13 Google Maps http://www.w3schools.com/googleapi/default.asp Maps basic Maps overlays

14 Static Map Image var x; function getLocation() { x = document.getElementById("demo"); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude; var latlon = position.coords.latitude + "," + position.coords.longitude; var img_url = "http://maps.googleapis.com/maps/api/staticmap?center="+latlon+"&zoom=14&size=400x300&sensor=false"; document.getElementById("mapholder").innerHTML = " "; } Click the button to get your coordinates. Try It

15 Google Maps http://www.w3schools.com/googleapi/default.asp var myCenter=new google.maps.LatLng(51.508742,-0.120850); function initialize() { var mapProp = { center:myCenter, zoom:5, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); var marker=new google.maps.Marker({position:myCenter,}); marker.setMap(map); } google.maps.event.addDomListener(window, 'load', initialize); function newLocation(lat,lng) { myCenter=new google.maps.LatLng(lat,lng); initialize(); } function getLocation() { newlat=parseFloat(window.prompt("Enter Latitude:")); newlng=parseFloat(window.prompt("Enter Longitude:")); newLocation(newlat,newlng); }


Download ppt "HTML5 Demo ISYS 350. HTML 5 validation/#.UdytIOLn_zc validation/#.UdytIOLn_zc."

Similar presentations


Ads by Google