When I had the job interview last weekend, I was asked if I had experience with Accordion Menus. Accordio-what??? I thought it was some kind of Javascript framework for easily creating menus.

I was only able to know what it was about until it was workday again and I got to surf for it so I could check what it was exactly. So, an accordion menu is actually a type of a menu that expands content (can be sub menu items or text or image or whatever).

The sample menu that was given to me to modify came from this site. The accordion menu in that URL was created using JQuery and is limited to one level only. There are no sub-menus. I think I did badly in that exam since I have never used JQuery extensively unless they were show() hide() funtionalities.

I decided to check JQuery out and try to make it work. What I did was use the same CSS class attributes and changed the code to cater sub-menus no matter how many level(s) a menu item has. The finished code would create an accordian menu that looks like the image on the right. I highlighted the sub-menus as blue and red.

I am not much of a CSS stylist so it is up to you to change the existing CSS code to, let’s say, have the text move a bit to the right so that they all won’t be aligned vertically.

Here is the JQuery code

And this is the HTML code. I provided 1 menu item sample that has 2 sub-menu levels.

Notice that in <p> and div tags (with ID firstpane), I added the attribute ID to give them unique identifier names. This is mandatory in my code because I used the tag’s ID to check if the menu header clicked is a parent menu header or a sub menu header.

Make sure that you have a main container, in this case, firstpane with CSS class menu_list. Next in the CSS sequence are the menu_head and the menu_body (contains your menu items or more sub-menus).

Last weekend, I had a job interview with regards to Javascript. I was asked if Javascript can pass values from one page to another. All I said was if it is possible, I can look it up in Google. When my initial exam started, I looked it up if it is indeed possible. And voila, cookies were mentioned. I have never used cookies in Javascript before so I totally had no idea until I looked it up. The best functions for me in setting and retrieving cookies in Javascript are the functions found in a W3Schools column.

Using these two functions below, you can set and get a cookie (depending on the expiry value you specify).

Even before this was released and only a teaser video was shown to the public, I was already excited about this game. This was unexpected for me, Mortal Kombat and … uh … DC? But hey, it is here! And I look forward to checking it out once it hits our malls here. Though I am not the gamer type anymore. I still enjoy watching the game fights when players play the game and the intro video that comes with the game. When I read a news article about the Joker’s fatality being censored in the U.S., I wondered, could the same happen here in the Philippines? As much as I do not like violence, I believe fatalities are what makes Mortal Kombat, well, Mortal Kombat. Without them, it would just be another fighting arcade game. Fatalities are what sets Mortal Kombat from other fighting games on uniqueness. And it has been said that the Joker’s fatality is among the best. Do you like it if the Mortal Kombat VS DC Universe game gets censored at your place? Check out this screenshot of the Joker.

Related Posts Plugin for WordPress, Blogger...