Archive for the ‘Javascript’ Category

Little jQuery Slider Navigation

Wednesday, February 2nd, 2011
Little jQuery Slider Navigation

I love the little stuff jQuery can do
I was noodling around the other day with jQuery, and decided to share another simple little navigation script. It is only 8 lines of code, which includes the ready function, and closing brackets, so if you actually take into account just the stuff that matters, only 5 lines. You can check out the demo below.

View Demo

Yes, all it does is move the arrow around on rollover, but it is a simple effect and you might be able to come up with something better knowing how to do this.

(more…)

Tutorial – CSS And jQuery/Ext Trap Door Navigation

Thursday, January 27th, 2011
Tutorial – CSS And jQuery/Ext Trap Door Navigation

Dual library action

I’ll be showing you how to do a trap door navigation, which I’m sure has been done before. But I’ll be showing you how to do it in jQuery AND Ext. Why? Because I had to do it in both at work. A trap door navigation is basically a two image system where the ‘li’ gets one image, and the ‘a’ tag gets another so that as the link expands, the image grows with it. When you rollover each navigation item, the images then change.

Why thought can’t you do this with just CSS? You could try like I did using something like ‘li:hover’, but the problem occurs on when the images actually change on rollover. There are issues with the ‘li’ image changing because the ‘a’ tag is on top and that is what you are rolling over. Javascript is used then to correct the issue. Check out the result:

View Demo

(more…)

A Simple jQuery Fly-Out Menu

Tuesday, January 4th, 2011
A Simple jQuery Fly-Out Menu

I haven’t made a post about jQuery in a while

Which is what made me decide to write my first post of 2011 on it. First, thank you to the people who commented here on The Web Machine in 2010. Also thanks to the over 730 RSS subscribers I have and the 25 or so followers on Twitter. This blog has been up for about a year now, and I look forward to this one. I hate all of you comment spammers though! So huge thanks to Akismet.

Anyway…a while ago I had thought about creating WordPress themes and try my hand at selling them, but it soon became apparent that the market was saturated. I don’t feel like wasting my time right now on putting effort into that. On one of those themes though, while I am not happy with the look, I created a fly-out menu using jQuery that I really liked. I thought I would share that with you since it takes less than 8 lines of code. So take a look at the demo, and then we’ll jump right in.

UPDATE 5/17/11: Removed the position:relative from the li style. It now gets the position:relative in the hover function in jQuery by adding/removing a class ‘addPosition’. This fixes the submenu appearing underneath the main menu in IE7/8. This was only noticable if you started changing the position of the submenu to be overlapping the main menu. My code here assumes you don’t do that, but with the fix it works great in IE7/8.

NOTE: In IE6, only the first level of the fly-out works. The second is cut off, but since most of us our on our way to not supporting it, I didn’t care. If you have the simple solution to fix that, let me know.

Original:
View Demo

More stripped down version (asked for in comments and the CSS now shown in sample code below):
View Demo

(more…)

Wijmo And Headjs Reviews

Monday, December 13th, 2010
Wijmo And Headjs Reviews

Undiscovered frontier

I love seeing new things being created to make web developers’ lives easier. Some suck, and some rock. Of course I am not the final judge. Usually I find these either from receiving a tweet or a list that shows all the stuff we, in theory, should be aware of. Two that I was intrigued by recently are Wijmo, a jQuery UI Widgets kit, and Head JS, which claims that it will be the only script you need in your head tag. Let’s get started, shall we?

Apparently Wijmo is from outer space

Aside from an attempt at humor, Wijmo makes a really bold claim:

There’s is a new highly volatile element for creating websites and web apps on earth. We call the new element “Wijmo”. Wijmo is a complete kit of over 30 jQuery UI Widgets. It is an extremely dangerous mixture of jQuery, CSS3, SVG, and HTML5 that when combined become an unstoppable force on the web.

(more…)

Another Simple jQuery Gallery Idea

Tuesday, November 9th, 2010
Another Simple jQuery Gallery Idea

Lock and Load that HTML

A co-worker had asked me for some help the other day on the jQuery running his gallery. Of course, I was more than happy to help. He ran into other issues later (which he cleared up) involving a plugin, but that doesn’t really matter in this demo/tutorial. What he wanted was to have a navigation at the top, each item pertaining to a different part of his portfolio (websites, flash work, graphic design…). Each section though had a ton of information that would increase the page load significantly if they were all loaded on the page at the same time. That ruled out putting a simple hide/show on some divs. My thought was, why don’t we put the HTML into separate files, and load them when a user clicks on one of the nav items. You can check out the gist of what was trying to be accomplished by check out the demo below.

View Demo

(more…)