Archive for April, 2007

Sexy sliding JavaScript side bar menu using mootools

253

Apr
30

When trying to conceive ways in which space could be saved on a web page I decided a sliding menu would work well as shown in the images below.

Sliding JavaScript side bar menu

Now for this solution I decided to use mootools due to the smoothness of their effects, however, this could just as easily be developed in script.aculo.us or other JavaScript libraries.

code

The code is very simple and is as follows:

CSS

    body{
        position:relative;
        paddign:0px;
        font-size:100%;
    }
    
    h2{
        color:#FFFFFF;
        font-size:90%;
        font-family:arial;
        margin:10px 10px 10px 10px;
        font-weight:bold;
    }
   
    h2 span{
        font-size:105%;
        font-weight:normal;
    }
   
    ul{
        margin:0px 0px 0px 0px;
        padding:0px 0px 0px 0px;
    }
   
    li{
        margin:0px 10px 3px 10px;
        padding:2px;
        list-style-type:none;
        display:block;
        background-color:#DA1074;
        width:177px;
    }
   
    li a{
        width:100%;
    }
   
    li a:link,
    li a:visited{
        color:#FFFFFF;
        font-family:verdana;
        font-size:70%;
        text-decoration:none;
        display:block;
        margin:0px 0px 0px 0px;
        padding:0px;
        width:100%;
    }
   
    li a:hover{
        color:#FFFFFF;
        text-decoration:underline;
    }
   
    #sideBar{
        position: absolute;
        width: auto;
        height: auto;
        top: 200px;
        right:-7px;
        background-image:url(images/background.gif);
        background-position:top left;
        background-repeat:repeat-y;
    }
   
    #sideBarTab{
        float:left;
        height:137px;
        width:28px;
    }
   
    #sideBarTab img{
        border:0px solid #FFFFFF;
    }
   
    #sideBarContents{
        overflow:hidden !important;
    }
   
    #sideBarContentsInner{
        width:200px;
    }

HTML

<div id="sideBar">
   
    <a href="#" id="sideBarTab">
        <img src="images/slide-button.gif" alt="sideBar" title="sideBar" />
    </a>
   
    <div id="sideBarContents" style="width:0px;">
        <div id="sideBarContentsInner">
            <h2>side<span>bar</span></h2>
           
            <ul>
                <li><a href="#">Link One</a></li>
                <li><a href="#">Link Two</a></li>
                <li><a href="#">Link Three</a></li>
                <li><a href="#">Link Four</a></li>
                <li><a href="#">Link Five</a></li>
            </ul>
           
        </div>
    </div>
   
</div>

As shown the code is not overly complex. The HTML comprises a containing DIV (with an ID of sideBar), then within this we have a linked tab image (with an ID of sideBarTab) followed by the contents of the side bar contained in a DIV (with an ID of sideBarContents) and sub contained within another DIV (with an ID of sideBarContentsInner).

The sideBarContents DIV has an inline style applied setting the width to zero. This is to allow the JavaScript to resize the region using mootools (Some browsers are a bit buggy when trying to change styles that are set in an external stylesheet). This DIV is also set to have an overflow hidden producing the effect that the content is sliding in.

Points to note within the CSS include the width set on the sideBarContentsInner DIV. This width should be adjusted as required to meet your deign requirements (It is set to 200px for the purpose of the demonstration).

Also to reposition the bar simply adjust the postioning styles applied on the sideBar DIV (i.e. right and top).

Finally you will need to include mootools.js and side-bar.js to the head of the document in the order shown for this to work. Have a play with the demo below and download the code.

demo

The sliding JavaScript side bar menu demo.

pitfalls

Currently with this version I believe there may be some CSS issues in Safari but as yet I haven’t had the time to fully test and fix potential bugs.

The next pitfall to note is the lack of degradability with JavaScript turned off, however, this will be fixed as stated below.

future

I am planning to develop a new version of the side bar that will degrade gracefully back into the structure of the site when JavaScript is turned off. This will provide a more accessible version.

Further improvements include adding a key press event to the tab allowing users without a mouse to produce the same effect (again important for accessibility).

Other considered enhancements include the introduction of multiple tabs. This would allow for greater “storage space”, whilst also providing flexibility and scalability.

download

Download the sliding JavaScript side bar menu.

Top 15 free and open source web developer tools updated

35

Apr
24

After my last article 15 must have web developer tools for beginners in which many of you commented that the tools were too expensive, I have decided to revive the list to include only free and open source tools.  There are many more tools that I could have posted and I more than likely will at the end of this article over the next few days, however, I feel the list below displays a very good start for any developer.  All comments and recommendations are welcome at the bottom of this article.  Lets see if we can get truly the greatest list of free and open source web developer tools.  :-)

1. GIMP

Very much a Photoshop esc application but free. GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

More about GIMP…

2. Aptana

The Aptana IDE is a free, open-source, cross-platform, JavaScript-focused development environment for building Ajax applications. It features code assist on JavaScript, HTML, and CSS languages, FTP/SFTP support and a JavaScript debugger to troubleshoot your code.

More about Aptana..

3. Color Cop

A very handy tool for capturing colours anywhere on your screen. Color Cop makes it quick and easy in those situations where you need to know what colour is being used.

More about Color Cop…

4. Firefox web developer toolbar

The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

More about Firefox we developer toolbar…

5. Internet Explorer Toolbar

The Microsoft Internet Explorer Developer Toolbar provides a variety of tools for quickly creating, understanding, and troubleshooting Web pages. This version is a preview release and behavior may change in the final release.

More about Internet Explorer Toolbar…

6. Firebug

Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

More about Firebug…

7. Watchfire WebXACT

WebXACT is a free online service that lets you test single pages of web content for quality, accessibility, and privacy issues.  It is very similar to Bobby and usefull to anyone wishing to check the accessibilty level of their templates/site.

More about Watchfire WebXACT…

8. JsUnit

JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript. Also included is a platform for automating the execution of tests on multiple browsers and mutiple machines running different OSs.

More about JsUnit here…

9. Xenu

Xenu’s Link Sleuth (TM) checks Web sites for broken links. Link verification is done on "normal" links, images, frames, plug-ins, backgrounds, local image maps, style sheets, scripts and java applets. It displays a continously updated list of URLs which you can sort by different criteria. A report can be produced at any time.

More about Xenu…

10. Vischeck

Vischeck is a way of showing you what things look like to someone who is color blind. You can try Vischeck online- either run Vischeck on your own image files or run Vischeck on a web page. You can also download programs to let you run it on your own computer.

More about Vischeck…

11. Feng GUI

Find out how people View your website or image and which areas are getting most of the attention.

The ViewFinder Heatmap service, is an artificial intelligence service which simulates human visual attention and creates an attention heatmap.

More about Feng GUI…

12. Fiddler

Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

More about Fiddler…

13. browsershots.org

Browsershots.org is a free open-source online service providing screenshots of your web site in a multitude of different browsers.  It is not as advanced as BrowserCam but a fantastic tool none the less.

More about browsershots.org…

14. Expresso 2.1

Expresso is useful tool for learning how to use regular expressions and for developing and debugging regular expressions prior to incorporating them into your code.  It provides a very cut down version of RegexBuddy but most importantly it is simple to use and free.

More about Expresso 2.1…

15. ColorJack

ColorJack is an amazing online application providing users with the ability to match colours that work well together.  Perfect for those developers who struggle to get a good colour scheme together.

More about ColorJack…

15 must have web developer tools for beginners

70

Apr
22

Here are 15 handy web developer tools.  Some are very well known others not so, however, one thing they all share is they are very useful when developing websites.

1. Adobe Photoshop

The Adobe Photoshop family of products is the ultimate playground for bringing out the best in your digital images and transforming them into anything you can imagine.

More about Adobe Photoshop…

2. GIMP

Very much a Photoshop esc application but free. GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

More about GIMP…

3. Adobe Dreamweaver

Quickly and easily design, develop, and maintain websites and web applications – from start to finish – with Adobe Dreamweaver CS3 software. Built for both designers and developers, Dreamweaver CS3 offers the choice of working in an intuitive visual layout interface or a streamlined coding environment.

More about Adobe Dreamweaver…

4. Color Cop

A very handy tool for capturing colours anywhere on your screen. Color Cop makes it quick and easy in those situations where you need to know what colour is being used.

More about Color Cop…

5. Firefox web developer toolbar

The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

More about Firefox we developer toolbar…

6. Internet Explorer Toolbar

The Microsoft Internet Explorer Developer Toolbar provides a variety of tools for quickly creating, understanding, and troubleshooting Web pages. This version is a preview release and behavior may change in the final release.

More about Internet Explorer Toolbar…

7. Firebug

Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

More about Firebug…

8. Watchfire Bobby

Watchfire Bobby is a web accessibility desktop testing tool designed to help expose barriers to accessibility and encourage compliance with existing accessibility guidelines, including Section 508 of the US Rehabilitation Act and the W3C’s Web Content Accessibility Guidelines (WCAG).

More about Watchfire Bobby…

9. JsUnit

JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript. Also included is a platform for automating the execution of tests on multiple browsers and mutiple machines running different OSs.

More about JsUnit here…

10. Xenu

Xenu’s Link Sleuth (TM) checks Web sites for broken links. Link verification is done on "normal" links, images, frames, plug-ins, backgrounds, local image maps, style sheets, scripts and java applets. It displays a continously updated list of URLs which you can sort by different criteria. A report can be produced at any time.

More about Xenu…

11. Vischeck

Vischeck is a way of showing you what things look like to someone who is color blind. You can try Vischeck online- either run Vischeck on your own image files or run Vischeck on a web page. You can also download programs to let you run it on your own computer.

More about Vischeck…

12. Feng GUI

Find out how people View your website or image and which areas are getting most of the attention.

The ViewFinder Heatmap service, is an artificial intelligence service which simulates human visual attention and creates an attention heatmap.

More about Feng GUI…

13. Fiddler

Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

More about Fiddler…

14. BrowserCam

Browsercam provides “Cross-Browser Screen Captures and Instant Remote Access”, meaning developers can fully test a websites appearance and functionality across multiple web browsers (I.e. Internet Explorer 7, Firefox etc) and operating systems (I.e. Windows XP, Windows Vista etc) ensuring the quality of our sites are as high as possible.
This solution offers three main services:
• Screen Capture Service
• Remote Access Service
• DeviceCam

More about BrowserCam…

15. RegexBuddy

RegexBuddy is your perfect companion for working with regular expressions. Easily create regular expressions that match exactly what you want. Clearly understand complex regexes written by others. Quickly test any regex on sample strings and files, preventing mistakes on actual data. Debug without guesswork by stepping through the actual matching process.

More about RegexBuddy…

comments

These are just a few handy web developer tools.  If you have any handy tools that you want to share post them at the bottom of this article.

Accessible HTML Forms using Definition Lists

7

Apr
22

Having adopted many different techniques for creating accessible html web forms I decided it was about time I standardised my approach to save time and effort.

The initial focus was on how to structure the form. Did I use DIVs or unordered lists or possibly definition lists? Well after much deliberating I came to the conclusion that definition lists were the way to go. They fit the bill and due their structure can be simply implemented to good effect.

Once that decision was made it was time to get stuck in.

code

The basic code structure is nice and simple.  Below you can see the definition list (dl) containing a term (dt) and a description (dd).  With in the term we store (on the most part – will explain later) the label for the form element with a relevant name.  Within the description we addd the form input.

The structure created by this approach is very clean and almost table esc.

<dl>
            <dt><label for="textbox1">Textbox 1</label></dt>
            <dd><input type="text" title="Textbox 1" name="textbox1" id="textbox1" /></dd>
</dl>

The above code shows the bare bones, however, as the code below shows we can make things slightly more complex.

Multiple textboxes

Textboxes can be added over multiple lines, or if required on the same line as shown below.

Multiple Textboxes

<dl>
            <!– Multiple textboxes Example Starts –>
            <dt><label for="textbox4">Multiple textboxes</label></dt>
            <dd>
                <input type="text" title="textbox4" name="textbox4" id="textbox4" tabindex="5" class="extra-small" />
                <label for="textbox5" class="hide">Month</label>
                <input type="text" title="textbox5" name="textbox5" id="textbox5" tabindex="9" class="extra-small" />
                <label for="textbox6" class="hide">Year</label>
                <input type="text" title="textbox6" name="textbox6" id="textbox6" tabindex="10" class="extra-small" />
            </dd>
            <!– Multiple textboxes Example Finishes –>
</dl>

Radio Button Lists

Radio buttons can be applied over multiple lines or across the same line as shown below.

Radio List

<dl>
            <!– Radio list Example (All on one line) Starts –>
            <dt>Radio List 1</dt>

            <dd>
                <input type="radio" title="Radio 1" name="radio1" id="radio1" value="1" tabindex="16" />
                <label for="radio1">Radio 1</label>
                <input type="radio" title="Radio 1" name="radio1" id="radio2" value="2" tabindex="17" />
                <label for="radio2">Radio 2</label>
                <input type="radio" title="Radio 1" name="radio1" id="radio3" value="3" tabindex="18" />
                <label for="radio3">Radio 3</label>
            </dd>
            <!– Radio list Example (All on one line) Finishes –>
           
           
            <!– Radio list Example (On multiple lines) Starts –>

            <dt>Radio List 2</dt>
            <dd>
                <input type="radio" title="Radio 2" name="radio2" id="radio4" value="1" tabindex="19" />
                <label for="radio4">Radio 1</label>
                <br />
                <input type="radio" title="Radio 2" name="radio2" id="radio5" value="2" tabindex="20" />
                <label for="radio5">Radio 2</label>
                <br />
                <input type="radio" title="Radio 2" name="radio2" id="radio6" value="3" tabindex="21" />
                <label for="radio6">Radio 3</label>
            </dd>
            <!– Radio list Example (On multiple lines) Finishes –>
</dl>

Checkboxes

Checkboxes can also be added over multiple lines or on the same line as shown below.

Checkboxes

<dl>
            <!– Checkbox Example (All on one line) Starts –>
            <dt>Checkboxes 1</dt>
            <dd>
                <input type="checkbox" title="Check 1" name="check1" id="check1" tabindex="8" />
                <label for="check1">Answer 1</label>
                <input type="checkbox" title="Check 2" name="check2" id="check2" tabindex="9" />
                <label for="check2">Answer 2</label>
                <input type="checkbox" title="Check 3" name="check3" id="check3" tabindex="10" />
                <label for="check3">Answer 3</label>
                <input type="checkbox" title="Check 4" name="check4" id="check4" tabindex="11" />
                <label for="check4">Answer 4</label>

            </dd>
            <!– Checkbox Example (All on one line) Finishes –>
               
           
            <!– Checkbox Example (On multiple lines) Starts –>
            <dt>Checkboxes 2</dt>
            <dd>
                <input type="checkbox" title="Check 5" name="check5" id="check5" tabindex="12" />
                <label for="check5">Answer 1</label>
                <br />
                <input type="checkbox" title="Check 6" name="check6" id="check6" tabindex="13" />
                <label for="check6">Answer 2</label>
                <br />

                <input type="checkbox" title="Check 7" name="check7" id="check7" tabindex="14" />
                <label for="check7">Answer 3</label>
                <br />
                <input type="checkbox" title="Check 8" name="check8" id="check8" tabindex="15" />
                <label for="check8">Answer 4</label>
            </dd>
            <!– Checkbox Example (On multiple lines) Finishes –>
</dl>

CSS

The CSS is very simple and simply lays out the form but does not apply any sexy formating – I’m a developer not a designer :-)

Firstly we have the basic form element styles:

/***************** Forms Styles Start ****************/
   
    form{
        margin:0px;
        padding:0px;
        font-family:arial;
        font-size:70%;
    }
   
    form input,
    form select,
    form textarea{
        font-size:110%;
        font-family:arial;
    }
   
    form textarea{
        height:100px;
    }
   
    form fieldset{
        border:1px solid #CCCCCC;
        margin:0px;
        padding:10px;
        display:block;
    }
   
    form legend{
        color:#666666;
        margin:0px;
        padding:0px;
        font-family:arial;
        font-size:130%;
        padding:0px 0px 0px 0px;
        *margin:0px 0px 0px -6px;
    }
   
    /**************** Forms Styles Finish ****************/

These styles provide very basic formating for form elements and can be changed as required.

Next we have the list styles.  These are used to provide the form with its structure and positioning.

/**************** List Styles Start ******************/
   
    form dl{
        margin:15px 0px 0px 0px;
        padding:0px;
        width:auto;
        clear:both;
    }
   
    form dt{
        float:left;
        width:200px;
        margin:0px 0px 5px 0px;
        color:#000000;
        font-size:110%;
    }
   
    form dd{
        margin:0px 0px 10px 200px;
        color:#666666;
        _text-indent:-3px !important;
    }
   
    form dd label{
        vertical-align:top;
        *vertical-align:baseline;
        margin:0px 8px 0px 0px;
        line-height:1.6em;
    }
   
    /**************** List Styles Finish *****************/

Finally we have some generic styles to apply width formating to form elements.

/*************** General Styles Start ****************/
   
    .extra-small{
        width:50px;
    }
   
    select.extra-small{
        width:55px;
    }
   
    .small{
        width:150px;
    }
   
    select.small{
        width:155px;
    }
   
    .medium{
        width:250px;
    }
   
    select.medium{
        width:255px;
    }
   
    .large{
        width:350px;
    }
   
    select.large{
        width:355px;
    }
   
    .hide{
        display:none;
    }
   
    /*************** General Styles Finish ***************/

These classes areapplied to individual form elements to give consistent widths and structure cross browser.  Again these can be changed as required to meet the individual needs.

Thats about it.  Check out the demo below and download the files to include the code in your site.  The code does validate to XHTML 1.0 transitional, however, I have included a couple of workarounds (*cough* hacks) to the css to keep consistancy across browser. 

The code also meets the WAI priority two checkpoint and only fails on priority three as there is no placeholder text within the form elements themselves.

demo

Accessible HTML Forms using Definition Lists demo.

download

Accessible HTML Forms using Definition Lists download.

CSS Support in Email Clients 2007

None

Apr
22

Just a quick article to point you all in the direction of a fantastic resource documenting CSS Support across a multitude of email clients.  This is the most complete guide I have found to date providing all the information you could possibly need.

article link

CSS Support in Email Clients 2007