Home
Dynamic Content
Here
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
FF3+ IE8+ Opera11+
HTML5 Notepad Author:
Dynamic Drive
Description: This HTML5 based "notepad" app uses HTML5's DOM Storage capability to allow users on your site to save and persist random bits of text for retrieval later, using the user's harddrive as the method of storage. The content does not ever expire until explicitly cleared by the user. It works in browsers that support DOM Storage, namely, IE8+, FF3+, Safari 4+, Google Chrome, and Opera 11+. Note: In IE8+ and FF3+, the script only works when viewed online (http web address). Demos: -"mynotepad1" launched
automatically when page loads. Add the below code inside the <HEAD> section of the page: The above code references the following two external files, which you should download (right click, and select "Save As"): Step 2: Then, to launch a HTML5 notepad, just call the function: notepad.loadpad(id, [x,y]) either automatically after the page has loaded, or dynamically via a link for example. The following code, added to the BODY section of your page, demonstrates both: This function accepts two parameters, the later being optional: notepad.loadpad(id, [x,y])
Templates used by each notepadThe output of each notepad is based on two templates as defined inside html5notepad.js: padHTML:'<div class="notepad"><span
class="close" title="Close Notepad">X</span><h3 class="title">Note Pad</h3>' While you're free to make simple changes to these templates, most of the class names used have special meaning and should be preserved. To edit the style of the notepad, including dimensions, open up and edit html5notepad.css. The significance of the ID parameter of notepad.loadpad(id)As documented above, the ID parameter of
|