|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionjawBar is a JavaScript implementation of Firefox 3's "Awesome Bar". While not a perfect implementation, it does contain a similar look and feel. BackgroundHaving recently downloaded Firefox 3, I found their new location bar rather delightful, if not a bit overwhelming. I decided that I would like to have a similar control to use in my own web designs. Using the codeInclude the jawbar.js file in your <script type="text/javascript" src="jawbar.js"></script>
<script type="text/javascript">
window.onload = function()
{
var jbar = new jawBar('awesome');
jbar.add({text: 'Ubuntu',
subtext: 'The best linux desktop around.',
icon: 'ubuntu.png',
searchValue: 'ubuntu linux os technology',
displayValue: 'http://www.ubuntu.com'});
jbar.add({text: 'CodeProject',
subtext: 'Free Source code and Programming help',
icon: 'codeproject.png',
searchValue: 'asp.net c# .net programming code technology',
displayValue: 'http://www.codeproject.com'});
jbar.add({text: 'Wikipedia',
subtext: 'An encyclopedia anyone can edit',
icon: 'wikipedia.png',
searchValue: 'wiki',
displayValue: 'http://en.wikipedia.com'});
jbar.add({text: 'JCritters',
subtext: 'MSAgent-style interactive critters',
icon: 'star.png',
searchValue: 'jcritter',
displayValue: 'http://www.jcritters.com'});
jbar.add({text: 'Slashdot',
subtext: 'News for nerds.',
icon: 'slashdot.png',
searchValue: 'slashdot code programming nerds technology',
displayValue: 'http://slashdot.org'});
jbar.add({text: 'Dictionary.com',
subtext: 'An online dictionary.',
icon: 'dictionary.png',
searchValue: 'dictionary', displayValue: 'http://www.dictionary.com'});
} </script>
ConstructorThe constructor is very simple, and takes only one argument, the ID of the textbox you want to convert into an awesome bar. var bar = new jawBar('myid');
...
<input type="text" id="myid"/>
Methods
Add() MethodThe
TechniqueComing next update.... BugsCurrently, if the I'm sure there are plenty of others. This code is more a concept than a finished product, so bugs and browser inconsistency is not unexpected. Points of InterestIn IE6, History
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||