HTML5 canvas example 2

Canvas is a new HTML5 element. Actually it’s a rectangular area enabled for drawing with JavaScript. This post shows random animation based on geometry of line and parabola. It is possible to run processes in parallel where more than one animation will be displayed on canvas.

HTML5 canvas example

The canvas is a new HTML5 element and it is used to draw graphs, charts, animations and other sort of graphics. Actually, canvas is a JavaScript controlled 2D drawing area. This example shows how to create simple JavaScript function and draw circles inside canvas tag.

JavaScript Array Move

This post shows how to extend JavaScript Array object with “move” method. The new method accepts two parameters: position 1 and position 2. Array element from position 1 will be moved to position 2 while rest of array will be shifted. Post includes live demo.

JavaScript Drag and Drop example 2

This post shows how to use Drag and Drop library described in my previous post “Drag and drop table content with JavaScript”. HTML table is stylized to have left column with content, main table and message line. Elements on the left side (green and orange) should be placed to the coloured table cells. After elements are correctly sited, appropriate message will be displayed.

Maintain vertical scroll position

This post describes how to maintain vertical scroll position after form submission or clicking on the link. Script will read vertical scroll position and append scroll value to the URL. After page is loaded, JavaScript function will search for the scroll parameter in the URL and set the scroll position.

JavaScript dialog box

If you aren’t satisfied with prompt, confirm, alert or, then this JavaScript dialog box can be your choice. Dialog box is emulated with two DIVs. First DIV overlays whole page (transparency is styled to 60%) while second DIV is positioned at the page center. That’s nothing new but JavaScript code is short, well commented and closed in own namespace (for easier integration with other frameworks).