Two CSS vertical menu with show/hide effects
Mar 31, 2008 Noticias
So I wrote this simple tutorial with two vertical menu examples with show/hide menu effect. First example uses a simple JavaScript code. Second example uses mootools to show/hide the menu with a nice vertical slide-in/slide-out effect.
Download the source code (it includes mootools framework) and take a look at the live preview to see how they woork.
Download this tutorial
Live preview
1. Menu with simple show/hide effect
Step 1.1: HTML Code
This is the basic example with a simple show/hide effect which you can implement just with some lines of JavaScript code (see next step). Our menu is a <ul> list wih a button (link) which calls a simple javascript function showElement() in the next step. HTML code is the following and you can customize it how you prefer simply changing the CSS code in the source file:
<span>Click Here</span>
</a>
<ul id=“v-menu” class=“v-menu” style=“display:none;“>
<li><a href=“p2.html”>Design</a></li>
<li><a href=“p3.html”>Css Gallery</a></li>
<li><a href=“p4.html”>Entertainment</a></li>
<li><a href=“p5.html”>Programming</a></li>
</ul>
Remember to add the property “display:none” in the ul element to hide the menu when an user load the page (it will appear only when an user clicks on the button).
1. Menu with simple show/hide effect
Step 1.2: JavaScript function
Now, in the head tag of the page, add this simple script to show/hide a generic HTML element using CSS display property:
function showElement(layer){
var myLayer = document.getElementById(layer);
if(myLayer.style.display==”none”){
myLayer.style.display=”block”;
myLayer.backgroundPosition=”top”;
} else {
myLayer.style.display=”none”;
}
}
</script>
showElement() function take in input the ID of the HTML element you want to show/hide. When an user clicks the button and CSS display property is set to “none” (menu hidden) this script will set the property with a new value “block” (menu visible).
2. Menu with Mootools toggle effect
Step 2.1: HTML Code
This second example adds a nice vertical slide-in/slide out effect to our menu using Mootools toggle effect. HTML code is not so different from the previous example. You have:
</a>
<ul id=“v-menu” class=“v-menu”>
<li><a href=“p2.html”>Design</a></li>
<li><a href=“p3.html”>Css Gallery</a></li>
<li><a href=“p4.html”>Entertainment</a></li>
<li><a href=“p5.html”>Programming</a></li>
</ul>
… You have only to add an ID to the button which show/hide your menu. It’s not necessary to add the property “display:none” I used in the previous example in <ul> to hide the menu when an user loads the page the first time. You can do it using mootools hide() function (see the next step).
2. Menu with Mootools toggle effect
Step 2.2: JavaScript/Mootools code
Now, first of all, add a link to mootools framework in the tag of your page using this line of code:
… ..and the following script immediately below the previous code:
window.addEvent(‘domready’, function(){
var myMenu= new Fx.Slide(‘v-menu2′);
myMenu.hide();
$(‘toggle’).addEvent(‘click’, function(e){
e = new Event(e);
myMenu.toggle();
e.stop();
});
});
</script>
In this way when an user clicks on the button, your menu will appear/disapper with a nice vertical slide-in, slide-out effect. myMenu.hide(); funcion hides the menu when the page is loaded.
Customize your menu changing CSS code
You can change the look of my menu simply changing some lines of CSS code:
Download the source code and take a look at the live preview to see how they woork.
Stock to watch Tuesday - NTAP, ISRG, MT , MSFT, INTC
Mar 31, 2008 Noticias
ISRG - Looks to have a bull flag formation on it here, after a couple of powerful days into it. Buy point would be on the day it blows through $335 on heavy volume.
Disclaimer : Trading stocks involves risk, this information should not be viewed as trading recommendations.The charts provided here are not meant for investment purposes and only serve as technical examples.
That’s All. Have a nice day !!!
AC
Avast, ye scurvy bastards!
Mar 31, 2008 Noticias
As a boy, George M. Wallace always wanted to talk like a pirate; in adulthood, he became an insurance lawyer. Click on the graphic above to see his excellent presentation of Blawg Review #153. Arrgh!
One shot, one kill: how to become popular with (almost) each post you write on your blog
Mar 30, 2008 Noticias
This post is dedicated to every people who wrote me asking to me how I made popular a lot of my posts on delicious in the past weeks. There is a “simple” way to make popular your post and assure a costant high traffic on your site for a medium period conquering a place on delicious home page… and this is what you have to do.
Step 1: Write something interesting
…otherwise it’s all useless.
Step 2: your link on delicious/popular page
If you want to conquer delicious home page with your new post, the first step is do appear your new post/link on del.icio.us/popular page:
How can you do it? It’s not so difficult if you have a medium daily traffic and a god number of feeds subscribers. I noticed in average 10-12 votes on delicious (users who save your link to their bookmars) in 30 minutes are enough to do appear your link on delicious/popular page and - this is the good news - immediatly you’ll receive a high number of new visits from this page.
The “bad” news is: if you want to remain for a long time on delicious/popular page page (and in this way have a possibility to conquer delicious home page) you have to mantain an increasing votes trend for your link. And how can you do it? The faster way is using social network to promote your new post.
Step 3: Publish it and promote it on social networks
In general I use this simple… let me say… “rule” which works very well: when I publish a post on Woork the first thing I do is add it to some general news sites (I use only digg, mixx, reddit) and other niche websites related to the topics about which I write on my blog (Dzone, Design Float and CSS Globe).
Combined effect in terms of visits from these websites produces in general the hoped result and the number of people who save your link on delicious will increase quickly. In this way after one / two hours your link on delicious will catch up 100 votes, enough to appears on delicious home page!
Blog Design Madness Round 2!
Mar 30, 2008 Noticias
With big pleasure I won the first round of Blog Design Madness on vandelaydesign.com. I received a lots of votes (woork has been the most voted site in this contest!) and I want to say thanks to everyone who voted me.
Today started the second round and you can vote for woork at this link:
http://vandelaydesign.com/blog/competition/round-two/
Thanks!
Weekend Herb Blogging #126
Mar 30, 2008 Noticias
Ramona from The Houndstooth Gourmet is hosting this edition of Weekend Herb Blogging and I think it’s about time I revisit one of the more surprising herbs
Yes, that is a banana and as I found out in an earlier WHB, bananas are indeed herbs - well the plants on which bananas grow are herbs and the banana is its fruit.
Nutritionally, bananas seem to contain a bit of everything - Vitamins A, B, B6, B12, C, E,K, Betaine, Choline, Folate, Niacin, Pantothenic Acid, Riboflavin and Thiamin as well as Calcium, Copper, Fluroride, Iron, Magnesium, Manganese, Phosphorus, Potassium, Selenium, Sodium and Zinc.
The recipe I’m making today is based on one from AWW’s “Cook” - I’ve made some minor changes to the ingredients to mirror my own preferences, hazelnuts replace walnuts and I’ve decreased the sugar but increased the nut and chocolate quantities. I’ve also given it a crunchy top in the form of a good sprinkling of pearl sugar.
Banana, Hazelnut and Chocolate Chip Bread
200 grams mashed bananas
140 grams caster sugar
2 eggs, lightly beaten
¼ cup melted butter
¼ cup milk
200 grams self-raising flour, sifted
120 grams chopped roasted hazelnuts (or filberts)
80 grams dark chocolate chips
pearl sugar, for topping
Place the mashed bananas and the sugar into a bowl and stir well to combine.
Add the chocolate chips and hazelnuts and stir them through.
Whisk the eggs with the melted butter and milk and then pour this into the banana mixture - stir again and then add the sifted flour.
Fold through until just combined.
Pour into a buttered and floured 9cmx27cm or 8 cup capacity loaf pan - sprinkle with pearl sugar and then bake in a preheated 160°C/320°F for about an hour or until cooked through and golden.
Cool slightly in the tin before turning out onto a wire rack.
If you eat it warm, the chocolate will still be gooey.
You can, if you show great restraint, cut thick slices and toast it the next day. It can also be used to make French toast.
Trade Ideas for Next week - JASO, ESV, WMT,JDSU, BIDU, RFMD, CREE
Mar 29, 2008 Noticias
That’s All. Have a nice weekend !!!
AC
Classic Teak
Mar 28, 2008 Noticias
Statistics of AC Investor Blog over week 13 ( from 22/3 to 28/3 )
Mar 28, 2008 Noticias
Some statistics of blog during the week 13
Posts: 10
Total Visitors : 2554
Total Page Loads : 4128
Most traffic from: USA, Portugal, UK, Germany, Austria
Enjoy your weekend !!!!
AC
Stonebridge Village
Mar 28, 2008 Noticias





