Friday, May 30, 2008

Pastel color menu with dynamic submenu using CSS

Do you want to add dynamic features to your menu?

This tutorial illustrates how to design a nice pastel color menu with a dynamic submenu which appears when you select a link in the main menu, using CSS and some lines of javascript code. The result is like this:


Download the source code to reuse it in your pojects (images included).

Download source code Live Preview


Step 1: HTML Code
HTML code is very simple: you can use the flexibility of elements ul, li to design the menu / Submenu structure. I added also a green header above the menu, which you can use to add for example your site logo:

<!-- HEADER -->
<div id="top-navigation">
<!-- Something in the header here -->
</div>

<!-- Main Menu -->
<div id="navigation">
<ul id="mymenu">
<li><a href="#" onmouseover="javascript:showsubmenu(1)">Home</a></li>
<li><a href="#" onmouseover="javascript:showsubmenu(2)">Movies</a></li>
<li><a href="#" onmouseover="javascript:showsubmenu(3)">Music</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>

<!-- SUB MENU -->
<div id="sublinks">
<ul id="s1">
<li><a href="#">General</a></li>
<li><a href="#">Information</a></li>
<li><a href="#">News</a></li>
</ul>

<ul id="s2">
<li><a href="#">Drama</a></li>
<li><a href="#">Thriller</a></li>
<li><a href="#">Action</a></li>
<li><a href="#">Horror</a></li>
<li><a href="#">Colossal</a></li>
</ul>

<ul id="s3">
<li><a href="#">Rock</a></li>
<li><a href="#">Pop</a></li>
<li><a href="#">Classical</a></li>
</ul>
</div>

How you can see each link in the main menu calls a javascript function showsubmenu() which takes in input the ID of the submenu you want to display.
Each <ul> element into the layer #sublinks is a submenu related to a link in the main menu. You can identify each submenu with a progressive id, for example in this case with: S1, S2, S3...


Step 2: CSS Code
Copy and paste this code in the <head> tag of your page:

ul, li{border:0; padding:0; margin:0; list-style:none;}

/* ----------- Navigation ----------- */
#top-navigation{
background:url(img/topnav-bg.gif) repeat-x;
width:auto;
height:48px;
margin:0 auto;
}
#navigation{
background:url(img/nav-bg.gif) repeat-x;
height:32px;
margin:0 auto;
width:auto;
}
#navigation ul{
height:32px;
line-height:32px;
}
#navigation ul li{
display:inline;
}
#navigation ul li a,
#navigation ul li a:visited {
background:url(img/line-a.gif) right no-repeat;
padding:0 20px;
display:block;
text-decoration:none;
float:left;
color:#4261df;
font-weight:bold;
text-shadow:#ffffff 2px 2px 2px;
}
#navigation ul li a:hover{
color:#1532a5;
}

/* ----------- Sub Menu ----------- */
#sublinks{
width:auto;
margin:0 auto;
background:#888888 url(img/sublink.gif);
height:30px;
font-size:11px;
}
#sublinks ul{
height:32px;
line-height:31px;
}
#sublinks ul li{
display:inline;
}
#sublinks ul li a,
#sublinks ul li a:visited {
padding:0 20px;
display:block;
text-decoration:none;
float:left;
color:#FFFFFF;
}
#sublinks ul li a:hover{
text-decoration:underline;
}

/* ----------- Hide Sub menu ----------- */
#s2, #s3{display:none;}

When the page is loaded for the first time I want to display by default the submenu with ID #S1. So, I have to set CSS display property for #S2 and #S3 to "none";


Step 3: Javascript Code
Now add this simple javascript function showsubmenu() to shows/hides the submenu related to the link on the main menu. This function takes in input a parameter which is the ID of the submenu you want to display (take a look at the step 1):



Copy this code in the <head> tag of your page:

<script type="text/javascript">
function showsubmenu(id){
submenu = document.getElementById('s'+id);
for(i=1;i<=3;i++){
if(i==id){
submenu.style.display="block";
} else {
document.getElementById('s'+i).style.display="none";
}
}
}
</script>

This line of code execute a for cycle from 1 to 3, where 3 is the total number of submenu you have in your HTML code (in this example #S1, #S2, #S3):

for(i=1;i<=3;i++)...


If you want to add a new link in the main menu with a new submenu related at this link, increase the condition (3) of one unit (4):

for(i=1;i<=4;i++)...


...and in the HTML code (step 1), remember to add a new ul element with ID="s4" in this way:

<ul id="s4">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
</ul>


It's all!

Download source code


Related Content
Simple CSS vertical menu Digg-like
Two CSS vertical menu with show/hide effects

Free Templates

Are you tired of looking at the default 16 templates that Blogger provides?You need Free Blogger Templates?In these websites you can find templates with good design for your BLOGSPOT Blog.Blogcrowds = http://www.blogcrowds.com/Bloggerbuster= http://www.bloggerbuster.com/Blogspottemplate= http://www.blogspottemplate.com/Eblogtemplates= http://www.eblogtemplates.com/Finalsense= http://

Tuesday, May 27, 2008

Google Spreadsheets Tips: Invert word position using formulas

Are you a Google Spreadsheets users? Take a look at this tips to invert words into a string.

Ok guys, finally I have a litte bit of time to add a new post on my blog. Today I want to return to talk about Google Spreadsheets, illustrating simple tips very useful to invert automatically (using some basic formula) the order of words in a cell.


You can also use all formulas in this example in Excel.

Take a look at the spreadsheet here

Download Excel file


Step 1 - Input data
For example, image you have a column with several names (name + surname):

Jack Bauer
Christian Troy
Gregory House
Micheal Scofield
Lincoln Burrows
...

...and for some reason you need to invert the order in surname + name. You can do it manually... but in case of more then ten names could spend a lot of time to do it. A good solution is using some formulas


Step 2 - Find a criteria to separate words
What is it the criteria you can use to split single words? In this example is the space (" ") between name and surname. You have only to find the "position" of the space (" ") to have a reference to split the content in the cell. You can do it using find() formula in this way:

=find(" ";B5;1)

This forumlas return the index (position) of the space (" "), contained into the text in the cell B5, starting to the position "1".



...for the cell B5 (Jack Bauer) the space is at position 5 (index = 5).

Step 3 - Extract words
Now, in a new column you can extract the surname and in another column the name. To extract the surname you can use right() formula combined with len() formula:

=right(B5;len(B5)-C5)

...where len() formula return the lenght (number of chars) of the text contained in the cell B5.

To extract the name you can use left() forumla:

=left(B5;C5)


Step 4 - Concatenate extracted words in a new order
Finally, you can concatenate words you extracted in the order "surname and name", using concatenate() forumla:

=concatenate(D5," ",E5)

...concatenate surname (D5), a space (" ") and name (E5).

It's all!

Take a mind, you can also use the same formulas in Excel but remember only to separate formula parameters using ";" instead of ",".


Related Content
See also:

EURO 2008 Tournament Schedule

UEFA EURO 2008 Schedule is a free spreadsheet with a calendar of all the games of the tournament and a group standing of each team. Designed as a Excel project, UEFA EURO 2008 Schedule automatically calculates the standing of every team without the use of macros. Schedule works very simple - all you need to do is to fill in the gaps of the teams with scores. Using the match results you

Free Forms for websites or blogs - tell a friend

Get a free tell a friend form to put on your website. Let your visitors tell their friends about how great your site or blog is. This is a great way to increase your traffic.Easy to use, free signup.Link/URL: http://www.tellingpeople.com/

Saturday, May 24, 2008

Free Email Address Verifier

Free Email Address Verifier is a email verification tool that actually connects to the mail server and checks whether the mailbox exists or not.What is being verified:Format: "name@domain.xxx"Valid domain: "somebody@new.york" is not validValid user: Verify that the user and mailbox really exist.Credits/source: Free Email Address Verifier website.Link / URL:http://verify-email.org/

Friday, May 23, 2008

"Woork" in progress...

Dear friends, long time is passed since my last post on this site. For all those who wrote me asking some info about my news I want to assure them: it's all ok. I am very busy with my work and it's very hard for me to mantain updated my blog.
In the past month I received a lot of e-mails from a lot of people and I couldn't reply to everyone. I'm sorry. I want to say thanks to everyone for your interest and your support.
I hope to add new post on my site as soon possible.

Best regards

Antonio


Monday, May 19, 2008

Free online file conversion

Amazing online tool for conversion of files like songs, videos, images and documents. Zamzar is dedicated to helping you transform your files into different formats. You can convert all types of files. Convert files from a URL on the Internet, integrate Zamzar into your web browser using the Zamzar browser button, convert videos directly from sites such as YouTube, Google Video,

Sunday, May 18, 2008

6 Free ways to get traffic to your blog

Everyone want's traffic.You set up a blog with great content but,no one is visiting your blog,so what's the use of it.So, you need at least a decent amount of traffic and what's great than getting that traffic for FREE?So,here is the good list of 6 Free ways to get traffic to your blog.1.SEARCH ENGINE:Yea! it brings lots of traffic to your blog.There are millions of people search in the search

Saturday, May 17, 2008

cool stuff for your photos

You want have fun with your Photos or digital Photos?You want some cool stuff?Some examples:FramerChoose from tons of unique frames to spice up your photos. Remember, if you frame it, it's art.Badge MakerMake your own ID card, press pass, name tag, unofficial Flickr badge, or any other kind of identification.Magazine CoverMake your own magazine cover! Be a superstar! Prove to your friends how

Friday, May 16, 2008

Free Music MP3 with google

With this trick you can get free music (mp3) from Google.You can get mp3 download links if you search like I will explain. All you have to do is search for this:"PUT HERE the Artist or band name" last modified mp3 "index of" -html -htm -php -asp For example, if you want to get some MP3 of MADONA:"MADONA" last modified mp3 "index of" -html -htm -php -aspEnjoy it.

Print Screen - Screenshot

Print Screen - ScreenshotScreenshot Studio: Have you ever used Print Screen to capture a screen?Have you ever used MS Paint or another Graphical Editor to edit your grabbed screen? Have you ever saved it to disk, opened e-mail or FTP client or web - browser to upload it onto public server to obtain opportunity to get a link and distribute it?Have you ever calculated how much time you spend

Protecting links

You need to protect your links to expire? You publish in your blog, site, links:rapidshare.com | rapidshare.de | megaupload.com | easy-share.com | filefactory.com ... so you need protect the links.Protect your links can save you a lots of time.Sites to protect links:http://www.link-protector.com/http://lix.in/http://protelink.com/

Wednesday, May 14, 2008

HUMAN RIGHTS - MAY 15

REMEMBER:

Favicons Creator - generator online

Favicons (favorite icons) are the small images that are associated with a website. They will be displayed on the address bar, on browser tabs, and in the bookmark list.In favicon.cc you can generate online your favicon. It is easy to use.http://www.favicon.cc/

Sunday, May 11, 2008

Tag Cloud Generator

You need one tag cloud for your website or blog?Generate your own Tag Cloud, for free and online.Here is one online tool to generate tag clouds. Easy to use.Link: http://www.tagcloud-generator.com/index.htmlWe used this tag cloud generator to do our tag cloud.Our tag cloud: DVD Ripper AVG 8 Flash Converters Avira Video Screen Capture L.I.A Trend Micro Account Management Online converter

Saturday, May 10, 2008

Online converter Icons

ConvertICO is a Free Online Converter .fast (you don't need to install the software and you don't need to register)easy to use (you need only 3 clicks to convert the PNG or ICO file) allows you to convert PNG to ICO (Windows Vista compatible) and ICO to PNG format files.ConvertICO is able to convert PNG or ICO (Windows Vista compatible) files located on your computer or on a webserver.I. To

Wednesday, May 7, 2008

Video Screen Capture - screen recording tool

Video Screen Capture - screen recording toolFreez Screen Video Capture is a screen-capture & screen-recording tool to record screen activities and sounds into standard AVI video files.You can record any part of the screen's activities and the cursor's movements, using a microphone to narrate your screen recordings.You can choose the output video's compressor (such as Microsoft Video 1, MPEG-4,

iPod Video Converter

Freez iPod Video Converter is a video conversion program that can convert batches of video files to MP4 video files to be played on your iPod.Freez iPod Video Converter supports most popular video formats that can be converted into iPod video. These include AVI, MPEG, WMV, ASF, MOV, RM, RMVB, DivX, Flv, SWF, VOB, 3GP etc. You can choose the output iPod MP4 video's video encoder (MPEG-4/H.264),

3GP Video Converter

3GP Video ConverterFreez 3GP Video Converter is a 3GP-converting tool for mobile phone users.With Freez 3GP Video Converter, you can convert batches of video files to 3gp, 3g2 formats to be played on mobile phones.Freez 3GP Video Converter supports most popular video formats to be converted to 3gp video, including : AVI, DivX,

GIF TUBE - animated Gifs

If you like GIFs you will like this service.GIF TUBE has many gifs in tube - animated gifs. Funny, Famous, Sport, Cartoon and Adult are the categories available in Gif Tube.Gifs at Giftube.com Gifs at Giftube.com Gifs at Giftube.com LINK: http://giftube.com/index

50GB of free online data storage

ADrive LLC (ADrive.com) - free online data storage, the largest amount of free storage on the Internet.ADrive provides users with secure solutions for storing, backing up, and accessing files from virtually anywhere, at any time.ADrive serves as an online, centralized vault for all file types including: music, videos, photos, documents, and other files.Basic Plan gives you up to 50GB of free

Tuesday, May 6, 2008

doPDF - free PDF converter

doPDF = Freeware - Lightweight - No nags - 30 languages.doPDF is a free PDF converter for both personal and commercial use. Using doPDF you can create PDF files by selecting the "Print" command from virtually any application. With one click you can convert your Microsoft Excel, Word or PowerPoint documents or your emails and favorite web sites to PDF files.CONVERT TO PDF:doPDF6.0 installs itself

Monday, May 5, 2008

HJ-Split - Split and Join Files

HJ-Split - Split and Join FilesHJSplit is a program that can split a file of any type and size into smaller parts, Eg: 1 file = 1.2 GB in 4 files of 300MB each.It can also join these parts back together again to restore the original file.Think of a file of 1.2 Gb, and try to send it to a friend in one go.Using email this does not succeed, it is simply too large.HJSplit will enable you to split

iPhone Theme Maker - online tool

Interesting online tool for users and "lovers" of IPHONE.In this online tool you can easily create custom iphone themes which can be downloadable to your PC / Mac / iPhone.Link to get to the site: http://iphonethememaker.com/

Convert Tube - Videos Convert

Convert Tube(online tool) allows you to convert and download an online video by simply providing the URL.Any file can be converted to an mpg, mov, 3gp(mobile), flv(flash), mp3 or mp4.License: Free service online.Link: http://converttube.com/

Free YouTube Uploader

Free YouTube Uploader is the first application ( PC desktop ) to upload video to YouTube without using the original YouTube web interface. Free YouTube Uploader is easy to use and will save lots of your time.It gives you, 100% warranty, that your video will not be rejected by YouTube due to incompatibility reasons.License: Freeware.Download Free YouTube Uploader (Click here)( Tested by: Info 5

Sunday, May 4, 2008

waterMark V2 - watermark your photos

WaterMark V2 is a versatile and very easy to use application for adding "watermark" images to your photos.All you need is to define a source image as watermark and place it where ever you want on the specific original photo.The transparency of the whole watermark or even a single colour can easily be set up to the needs by a control panel working in percent.All these settings can be added as a

Widgetbox - widgets

Web widgets are portable chunks of the Web that can be easily embedded into a webpage. Use them to get news, information, entertainment, decoration, or whatever else you can think of for your blog, profile page, personal home page, or web site. Widgetbox helps people express, connect, create and inform using web widgets that can be easily shared and distributed anywhere on the web. Our

Privacy Policy Generator ( ADSENSE )

Google made a change in their Google AdSense webmaster terms.All publishers must have a Privacy Policy on web sites that display AdSense ads.You are asking to yourself HOW TO DO THAT?What is supposed to put in this privacy policy?Don´t worry, it is easy, I give you 2 tips:Serp Rank - Privacy Policy Creator (Generator):http://www.serprank.com/privacy-policy-generator/index.phpDMA - Privacy Policy

Saturday, May 3, 2008

Video "45 Ways to Power Up Your Blog"

Excellent video with tips for bloggers.It is a long video, 1:12:13, but if you have a blog you must see. I see and I recommend.John Pozadzides' lecture on "45 Ways to Power Up Your Blog" from Dallas WordCamp 2008:Credits: Viddler website.

3D software tool - 3 websites - free download

Maya Personal Learning Edition (PLE) is a special version of Autodesk® Maya® software, which provides free access to Maya for non-commercial use. It gives 3D graphics and animation students, industry professionals, and those interested in breaking into the world of computer graphics an opportunity to explore most aspects of the award-winning Autodesk® Maya® Complete software in a non-commercial

Friday, May 2, 2008

Revo Uninstaller (free)

Revo Uninstaller: helps you to uninstall and remove unwanted programs installed on your computer even if you have problems uninstalling and cannot uninstall them from "Windows Add or Remove Programs" control panel applet. Revo Uninstaller is a much faster and more powerful alternative to "Windows Add or Remove Programs" applet! With its

Dynacom - Account Management

Accounting basics:invoicing, purchasing, sales,general ledger, banking, etc.Fully functional, no strings attached, no limitations.Good to manage a business.That seems too good to be true, but it is free. No catch.Dynacom is offering a free software in conjunction with its affiliated partner program simply to make its product line even better known.Credits: Dynacom website.License: Freeware.http

Nokia PC Suite connect mobile to a PC

Nokia PC Suite is a free PC software product that allows you to connect your Nokia device to a PC and access mobile content as if the device and the PC were one.Credits/source: Nokia-Europe website.Download Nokia PC Suite Here( tested by: info5stars )

Recuva - File Recovery

Recuva - File RecoveryRecuva (pronounced "recover") is a freeware Windows utility to restore files that have been accidentally deleted from your computer.This includes files emptied from the Recycle bin as well as images and other files that have been deleted by user error from digital camera memory cards or MP3 players.It will even bring back files that have been deleted by bugs, crashes and

AVG - Free Anti-virus

AVG - Free Anti-virusAVG Free is available free-of-charge to home users, is an anti-virus scanner that offers Resident Protection, e-mail Scanner, On-Demand Scanner and Virus Vault for safe handling of infected files and automatic updates.AVG Free is easy-to-use.AVG Fee will not slow your system down (low system resource requirements). License:Freeware - Free Windows2000/XP/2003/

Thursday, May 1, 2008

Mypictr - picture resizing online

Mypictr provides a picture resizing service online.Mypictr allows you to create a custom profile avatar for your favorite social network. You don't need to install any programs, plug-ins or any other software, just upload your picture, resize it online and download it from our server.You can recive the image by email too.Imagine following situation: you are about to create a new profile at a new