Featured Story
Windows Presentation Format
Getting ahead with WPF
For those of you who haven’t taken the time to explore WPF, you should definately put this at the top of your “to do” list as it becomes more widely held as a programming standard.
Windows Presentation Foundation (or WPF) is a graphical subsystem for rendering user interfaces in Windows-based applications. WPF, previously known as “Avalon”, was initially released as part of .NET Framework 3.0. Since that time it has become a widely held as a programming standard. Silverlight utilizes WPF to provide embedded web controls similar to Adobe Flash,
[continue reading...]Free Featured Software: PointandSee 1.1.0
Trent found this free download while looking for new free software downloads he felt were worth mentioning on the free software blog.
I think it’s probably the handiest little tool I’ve had in a long time. It’s a color finder. Basically, you open the application (very, very small) and then drag over the color you want to find the values for. It gives you the hexadecimal and rgb values of the color. It also has a little past icon so you don’t have to go back and forth getting the color values.
Totally free and very small – this one belongs in the “gotta get this” category. The full publisher’s description and download link are located in the software downloads blog.
If you have a free application you would like reviewed, drop us a note and we’ll take a look.
How To: JQuery Accordion Menu Step By Step
Experience Level: Intermediate
Download source code and working example
This step by step explanation of the accordion menu using JQuery. This example shows how to the right side bar menu on our website was built.
There are 4 parts needed to implement a JQuery drop down menu. This website being a wordpress site it uses PHP but this example has been written in simple HTML. Also because it’s Java the operating system can be Windows or Linux.
The 4 Parts
- JQuery file: You’ll need either a reference to a JQuery file via the internet or to have a copy on your own hosted site. Personally I prefer to have my own copy rather than using say the Google API. Reason being that should there be a change in the syntax or method being called it could break without warning. Having a copy on the server ensures that it will work. This example uses the jquery-1.2.3.pack.js version but this function is so basic that any of the versions will work.
- Cascading Style Sheet: You can add the style reference directly on the page but seriously why? I’ve never understood why styles would be added directly to the page. Just bad practice.
- The Java Script code: This adds the onclick event when the page is loaded. Again, you could add it directly to the page but why? If you wanted to re-use the script it would be pointless.
- HTML page: Really just HTML so it doesn’t have to be an .html file itself. Can go on any type of web page.
jQuery Selectors
What is jQuery? If you haven’t heard of jQuery or had a chance to check it out you really should. jQuery is designed to change the way that you write JavaScript.
Using Visual Quickstart Guide’s jQuery book makes things really simple and easy to understand. For those of you who don’t know jQuery is a JavaScript library that simplifies coding a lot. Because of some of the function in the jQuery library code that used to take up a quarter of the page can be simplified into 1 or 2 simple lines. On top of that there are some other really cool features that are a part of jQuery.
One of jQuery’s specialties is letting you select page elements so you can work with them. Selecting page elements is a big part of online work. Until now almost all selection capabilities involved the getElementByID(), getElementsByName(), or some type of for each statement which all work but are limited, time consuming and take unnecessary overhead. jQuery on the other hand goes above and beyond these methods. In jQuery your able to select by descendants, by children, by specific text, by attribute, by attribute value, and even by position all by just one simple line of code changed based on what your selecting.
For example lets say I want select all the elements with a language attribute of Portuguese. In JavaScript the only way to do this would be to add an ID tag on each and every element with the language attribute of Portuguese, which may not seem like that big of deal but if you didn’t add it when you first programmed, it can be. In jQuery all I have to do is add this line of code:
$(‘p[language=''Portuguese']‘)
and then add the function or whatever action I want it to run. While it may not make things shorter it sure does simplify.
One of the most powerful selectors in my opinion is the ‘checked selector, which lets you select checked check boxes and selected radio buttons. Using this you can tell which elements are checked and which aren’t rather than the cumbersome “if value checked or if true” logic required prior to jQuery.
Here’s a quick example:
Function count()
{
alert(“You checked ” +
$(“input:checked”).length +
” items.”);
}
By entering this in a script tag and using the checked selector I can see how many check boxes were selected. The selectors in jQuery make it much easier to work online. I’ve talked about a few selectors here but there are so many more built into jQuery giving you a variety of ways to select elements.
If you’re looking for a good book on jQuery you should check out Visual Quickstart Guide jQuery by Steven Holzner. Its provides a bunch of good examples.