Wednesday, March 30, 2011

Devanagari Virtual Key Board For your site

Today I came across this wonderful piece of JavaScript thought to share with you all.
Ever wonder of having a virtual keyboard of Devanagari in your site, here you have it.

Code at work

google.load("elements", "1", {packages: "keyboard"});

function onLoad() {
var content = document.getElementById('content');
// Create the HTML for out text area
content.innerHTML = '
(Scroll down) ' +
'You can click the buttons on the onscreen ' +
'keyboard to type Devanagari. You can also type Devanagari '+
'with your keyboard. When you need to type English, ' +
'please click the [-] button to minimize the keyboard.' +
'
';

var kbd = new google.elements.keyboard.Keyboard(
[google.elements.keyboard.LayoutCode.HINDI],
['t1']);
}

google.setOnLoadCallback(onLoad);