Saturday, September 13, 2008

Yet another tweak to my dropdown menu.

Previously I implemented the dropdown menu on the side. Yeah it is working fine and dandy, thank you very much if no one has noticed.


However 1 little thing bugged me. When you choose the website you want to visit from the dropdown menu, the new site loads in your current browser.

I am not exactly a fan, because I want my little blog to be a reference point for all my skiving reads. I don't want to go back a few webpages just to reach my blog to hop to another website.

The code below lets me have dropdown menu.
<form name="linksmenu">
<select name="url" size="1" class="dropdown" onChange="location = this.options[this.selectedIndex].value;">
<option value="" selected> -- Humourous blogs that will have you chuckling out loud -- </option>
.
.
(My other links blah blah blah)


By changing the line from
<select name="url" size="1" class="dropdown" onChange="location = this.options[this.selectedIndex].value;">
to
<select name="url" size="1" class="dropdown" onChange="javascript:window.open(this.options[this.selectedIndex].value);"

Now my dropdown menu open links in a new window/tab!

I'm positively joyous. =D




No comments:

Related Posts Plugin for WordPress, Blogger...