Javascript Articles

Page 506 of 534

Stop Web Workers in HTML5

Nishtha Thakur
Nishtha Thakur
Updated on 28-Jan-2020 1K+ Views

Web Workers allow for long-running scripts that are not interrupted by scripts that respond to clicks or other user interactions and allows long tasks to be executed without yielding to keep the page responsive.Web Workers don't stop by themselves but the page that started them can stop them by calling terminate() method.worker.terminate();A terminated Web Worker will no longer respond to messages or perform any additional computations. You cannot restart a worker; instead, you can create a new worker using the same URL.

Read More

Creating content with HTML5 Canvas much more complicated than authoring with Flash

Anvi Jain
Anvi Jain
Updated on 28-Jan-2020 175 Views

Flash provides amazing GUI and lots of visual features for animations. It allows the user build everything inside a particular platform without a full integration into the browser wrapped inside the browser with the main scopes that are multimedia and other kinds of animation.HTML5 element gives you an easy and powerful way to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions or do simple (and not so simple) animations.Here is a simple element which has only two specific attributes width and height plus all the core HTML5 attributes like id, name, and ...

Read More

What is composition in HTML5 Canvas?

Arjun Thakur
Arjun Thakur
Updated on 28-Jan-2020 336 Views

HTML5 canvas provides compositing attribute globalCompositeOperation that affect all the drawing operations.ExampleWe can draw new shapes behind existing shapes and mask off certain areas, clear sections from the canvas using globalCompositeOperation attribute as shown below in the example.                    var compositeTypes = [             'source-over','source-in','source-out','source-atop',             'destination-over','destination-in','destination-out',             'destination-atop','lighter','darker','copy','xor'          ];          function drawShape(){             for (i=0;i

Read More

How to handle mousedown and mouseup with HTML5 Canvas

Daniol Thomas
Daniol Thomas
Updated on 27-Jan-2020 896 Views

To handle the mousedown and mouseup event with HTML5 Canvas,var mouseDown = false; // for mousedown canvas1.onmousedown = function(event){    dragOffset.x = event.x - mainLayer.trans.x;    dragOffset.y = event.y - mainLayer.trans.y;    mouseDown = true; } // for mouseup canvas1.onmouseup = function(event){    if(mouseDown) mouseClick(eevent    mouseDown = false; }

Read More

How to display HTML5 client-side validation error bubbles?

Arjun Thakur
Arjun Thakur
Updated on 27-Jan-2020 386 Views

To display HTML5 client-side validation error bubbles, use the required attribute.You do not need to have JavaScript for client side validations like empty text box would never be submitted because HTML5 introduced a new attribute called required which would be used as follows and would insist to have a value:                    Enter email :          Try to submit using Submit button                    

Read More

IE supports the HTML5 File API

Daniol Thomas
Daniol Thomas
Updated on 27-Jan-2020 183 Views

IE9 does not support File APIIF10 started supported File APIAn example of that would be drag and drop. Now HTML 5 came up with a Drag and Drop (DnD) API that brings native DnD support to the browser making it much easier to code up.                    #boxA, #boxB { float:left;padding:10px;margin:10px; -moz-user-select:none; }          #boxA { background-color: #6633FF; width:75px; height:75px; }          #boxB { background-color: #FF6699; width:150px; height:150px; }                      function dragStart(ev) {   ...

Read More

Make HTML5 Canvas fill the whole page

Chandu yadav
Chandu yadav
Updated on 27-Jan-2020 3K+ Views

To make canvas fill the whole page, you need to be 100% in width and height of the page.* {    margin: 0;    padding: 0; } body, html {    height:100%; } #canvas {    position:absolute;    height:100%; width:100%; }

Read More

Is there any way to embed a PDF file into an HTML5 page?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 27-Jan-2020 761 Views

To embed a PDF file in an HTML5 page, use the element.           HTML iframe Tag               HTML5 Tutorial          

Read More

What is the correct use of schema.org SiteNavigationElement in HTML?

Daniol Thomas
Daniol Thomas
Updated on 27-Jan-2020 839 Views

The schema.org SiteNavigationElement extends WebPageElement. It is used to mark-up links that would make amazing contextual links.                    Home page                              My demo page          

Read More

How to “enable” HTML5 elements in IE 8 that were inserted by AJAX call?

George John
George John
Updated on 27-Jan-2020 344 Views

To enable HTML5 elements in IE, you need to use plugins like html5shiv. The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 styling for Internet Explorer 6-9,With that, you can also use document.createElement to create an element.var demo = document.createElement("demo"); demo.innerHTML = "Working!"; document.appendChild(demo);

Read More
Showing 5051–5060 of 5,338 articles
« Prev 1 504 505 506 507 508 534 Next »
Advertisements