Friday, March 23, 2007

I've been working on a quick prototype of a CSS javascript menu. Here's the preview (click for live demo):

Doesn't look like much, but images could easily be added to dress it up. The best part is the HTML – there's not much to it. I used the example from this CSS javascript menu as my base and dressed it up from there. Here's the key: keep your script out of the HTML. By using IDs and relative DOM paths, you can significantly cut down on the amount of javascript that usually finds its way into the HTML. Notice that the only references to script are the script links at the top of the page:

    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2
 <html xmlns="http://www.w3.org/1999/xhtml" >
    3
 <head>
    4
     <title>Untitled Page</title>
    5
     <link type="text/css" rel="stylesheet" href="navbar.css" />
    6
     <script src="prototype.js" type="text/javascript"></script>
    7
     <script src="scriptaculous.js?load=effects" type="text/javascript"></script>  
    8
     <script type="text/javascript" src="navbar.js"></script>
    9
 </head>
   10
 <body>


The rest of the HTML is as follows:

   12 <div id="menu">
   13

   14
     <div id="submenuContainer"></div>
   15

   16
     <dl>
   17
         <dt color="#ffaaaa" selected><a href="#">Menu 1</a></dt>
   18
         <dd>
   19
             <ul>
   20
                 <li><a href="#">Sub Menu 1.1</a></li>
   21
                 <li><a href="#">Sub Menu 1.2</a></li>
   22
                 <li><a href="#">Sub Menu 1.3</a></li>
   23
             </ul>
   24
         </dd>
   25
     </dl>
   26
 

...
   60
   61
 </div>
   62

   63
 </body>
   64
 </html>

 

In order to do this, I use the help of the prototype javascript library. Prototype allows navigating the DOM in a painless fashion:

   27 function initSubmenus() {
   28
     $$('#menu dd').each(function(dd) {
   29
         var st = dd.style;
   30
         st.display='none';
   31
         st.top='18px';
   32
         st.left='1px';
   33
     });
   34
 }

...
   73     var submenu = $(this).next('dd');

Saturday, March 24, 2007 12:52:54 AM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
 Saturday, March 17, 2007

This is off-topic from my normal technical-ish (developer-related) ramblings, but I have recently read several blog posts that reminded me of this oft-forgotten rule: "your interest" was most likely not "peaked" or "peeked"... your interest was piqued

For this and other interesting common misuses of the English language (of which I'm sure I have one in this post! :-D) see "Common English Errors."

That is all – now back to your regularly-scheduled geek ramblings...

Sunday, March 18, 2007 5:43:45 AM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, February 23, 2007

Get Coding with Vista and .NET 3.0 (WCF, WPF, WF, and CardSpace)

Here's what you'll need:

Friday, February 23, 2007 5:17:58 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, February 20, 2007

Screenshot Utility

This screenshot utility does it all:

  • Beautiful drop shadows
  • Auto save-to-disk
  • Image rotation
  • Multiple object selection
  • Vista support
  • Corner rounding
  • Drop shadow transparency
  • And more…

WinSnap is one of the first-to-install utilities on any new machines. It seems that no matter what I build the computer for, I end up needing or wanting to take screenshots.

What's more – it works seamlessly with Word 2007 for blogging: I can take great screenshots and then add slick affects to them in about 5 seconds. In this example screen shot, WinSnap did everything except the reflection.

It's also great for emailing screenshots to friends and co-workers. Since WinSnap saves images to the clipboard as PNGs (be default), image size is significantly reduced when pasting images into emails.

Just about my only complaint… when I tried to take a screenshot of WinSnap its self – it kept getting out of the way!

There's a free version available, though you shouldn't mind paying for the full version in all its glory. WinSnap is worth every cent.

 

Tuesday, February 20, 2007 6:31:08 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, February 05, 2007

When I came in to the office this Monday morning my computer was dragging pretty badly, so I did what any other Windows performance sleuth would do: I fired up Process Explorer. This is what jumped at me:

The memory usage is a "bit" on the high side…

Note to self:

Don't leave Firefox running over the weekend.

Monday, February 05, 2007 5:04:24 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |