JQuery Accordion menu

Sunday Nov 25 2007

This post is here for historical / archival purposes. Comments are disabled. Please visit the link below for the latest version of the JQuery accordion.

Yup, yet another JQuery Accordion Plugin

This weekend I did a simple using . I figured it would be nice to share it on my blog as it may be useful to other people. I have no idea if this has already been done, if someone else has done a better job at it but... this one is mine! Feel free to use it if you need an accordion component on your (non commercial) website.

I whipped up a little demo page where you can see the menu in action and download the source. The menu will open with the first submenu expanded and items that don't contain a submenu will behave like regular links.

I didn't think I'd need to make this remark but: please don't be an asshole and do what these people from html.it did. Not with this, not with any of my other stuff, heck, not with anyone's stuff. It's just wrong. Thanks!

Source

  1. function initMenu() {
  2. $('#pagemenu ul').hide();
  3. $('#pagemenu ul:first').show();
  4. $('#pagemenu li a').click(
  5. function() {
  6. var checkElement = $(this).next();
  7. if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
  8. return false;
  9. }
  10. if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
  11. $('#pagemenu ul:visible').slideUp('normal');
  12. checkElement.slideDown('normal');
  13. return false;
  14. }
  15. }
  16. );
  17. }
  18. $(document).ready(function() {initMenu();});

Go to the demo page to take a look and download it if you like it.

small update: I added a version that acts as a simple collapsing menu. Even less code needed for that:

  1. function initMenu() {
  2. $('#menu ul').hide();
  3. $('#menu li a').click(
  4. function() {
  5. $(this).next().slideToggle('normal');
  6. }
  7. );
  8. }
  9. $(document).ready(function() {initMenu();});

Safari 3 weirdness update

In the comments a problem with Safari was described. I just tried the example page in the latest nightly build of Webkit and it's working fine. I guess it's therefore safe to assume we're dealing with a Safari 3 bug.

bookmarking

What would an evil Pleo be capable of, and should we be scared?

Sunday Nov 18 2007

TerminatorLast week I posted about Pleo, a cute little 'pet robot' with remarkably advanced features. Yet this extremely sophisticated piece of machinery costs only $350 which includes a probably pretty nice profit for the manufacturer. While definitely looks amazing, cute and very cool to play around with it does bring up some concerns. I noticed that some people who saw the video's got a 'bad feeling' even though they thought it's cute. In other words, Pleo kind of freaked them out by being so 'real' while it really is just a (pretty advanced) toy. I'm quite sure there will be people who will even go as far as thinking that "it's the work of satan!" when they see it. In a certain way I suppose I share the various concerns people have. I guess we could ask ourselves the question: "If a $350 toy can be this advanced then what would a $5 million military purpose owned by a be capable of? And what will this situation be like in 10 years from now? Or 20?

SWORD
SWORD: a real battle robot. Fortunately not all that Terminator-ish yet...

Isaac Aasimov invented the Three Laws of Robotics which sound like a solid foundation to prevent a catastropy. But... Aasimov's work is science-fiction. And this is the real world. And the laws are already being broken as we speak. In the illustration used in this article you see , a United States battle robot. So much for the three laws...

(continue reading...)
bookmarking

Pleo, an amazing piece of technology

Thursday Nov 15 2007

Remember the little robot pets in 80's sci-fi movies? They're here now! Today I ran into Pleo, a highly advanced and super cute pet robot. The videos look absolutely awesome and I've never seen any toy this advanced. is packed with CPU's, touch sensors, servo motors, microphones, a camera and much more, resulting in an amazingly life like robot that behaves suspiciously much like a real animal. At some point I'll definitely be getting one.

I already have a 'valid excuse' to burn the hefty price of $350 USD because my fiancee's little girl will surely love it! And Daddy Marco will enjoy hacking it for sure! Fun for the little princess and fun for me! ;) The robot supports software updates and hacks through an SD card slot in it's belly, it's 'LifeOS' operating system is fully open and manufacturer Ugobe promises firmware updates, new behaviour packs and the really exciting part is in the FAQ:

Software customization can be accomplished without a screwdriver. UGOBE will support various toolsets that allow customization, from high-level behavior modification to low-level (nuts and bolts) application authoring. Visit http://pleoworld.com/developers this winter for more information.

P.S: UGOBE, don't hesitate to send me one to review :P

Some more videos:

Tags: , , , , .

bookmarking

Popular Articles

    Technology Blogs - Blog Top Sites

     

    • Featured Links
    RockySomewhere near the Orion NebulaBookalicio.usGolden Gate BridgeThames River BankJackie and mePimpin' it