For those who have lack of space in the sidebars.
Use this java/html code for a drop down link box that just take about no space at all :)
Add as many links to it as you want sor fast access to something within your own site, or to another site.
I use it at my hompage if anyone want to try it out
<Script language="JavaScript">
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</SCRIPT>
<FORM NAME="form1">
<SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
<OPTION VALUE="">-------JUMP TO-------
<OPTION VALUE="http://www.bloczone.net">BlocZone
<OPTION VALUE="/forum/home">Home
<OPTION VALUE="URL GOES HERE">SITE
<OPTION VALUE="URL GOES HERE">SITE
<OPTION VALUE="URL GOES HERE">SITE
<OPTION VALUE="URL GOES HERE">SITE</SELECT>
</FORM>
Cool, thanks for the info ;)
That's really helpful block snippet, thanks g6cad. :)
Later, crip
:laugh:
I know this may sound a bit nitpicky, but what you have there is a javascript function, not java. The two are very different animals.
;D
I adjusted the thread title for you.
BTW - nicely done.... ;D
I was just going to ask about this this morning. ;)
Incredibly useful. Love it !!!!!!!!
Very cool g6! I like that idea, I just might have to use it in my upcoming site update, if I ever get to it... :)
what would you change to get the links to open in a new browser? i have tried various things but can't get them to work. ???
You just type in the URL after the <OPTION VALUE=
Like this <OPTION VALUE="http://www.bloczone.net">BlocZone
G6, what i want it to do is open the links in a new window rather then the link opening in the current window taking users away from my site.
Quote from: rbh on April 10, 2006, 04:03:22 PM
G6, what i want it to do is open the links in a new window rather then the link opening in the current window taking users away from my site.
Nice job and thanks, I also want a new window any ideas?
well, i played around for awhile and finally came out with this. it also includes a go button so the link doesn't load automatically in case people choose the wrong link accidentally.
<script>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_blank";};
if (ref != "") {land(loc,target);}
}
//-->
</script>
<form action="dummy" method="post"><select name="choice" size="1">
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
<OPTION VALUE="URL">LINK NAME
</select><input TYPE="button" VALUE="GO!" onClick="jump(this.form)"></form>
if you don't want the go button just remove <input TYPE="button" VALUE="GO!" onClick="jump(this.form)">
if you want to have it open in the same window just change the target to self instead of blank in this line else {loc=ref; target="_blank";};
and if you really want to customize each individual link just copy *_blank after each url changing blank to self or parent depending on how you want the specific links to open, for example, a link to open another part of your forum or webpage would have *_self after the url, while a link to another website would have *_blank after the url.
example <OPTION VALUE="http:///www.yahoo.com*_blank">Yahoo
<OPTION VALUE="http://www.myforum.com/pictures.htm*_self">Pictures
rbh,
Script would not work for me. I got error on page message at bottom left of main window.
you might double check that you are copying everything correctly and that you are putting this code into a scriptbox. i just copied this code and tested it on my site to make sure i had it posted correctly, and it worked.
Make sure you put it in a HTML/Javascript Block (script Block)
All set thanks
This is a great block!
And I realize this is probably "in your face" obvious, but I have a question -
I've tried every way I know of to manually set the width, and none seem to work once I input them into the block. I want to use several of these drop-downs, but the link titles in each grouping are of varying widths - so they end up appearing staggered.
I'm playing with TP and this script on my test forum if you want to see what I mean:
http://www.soulofadoption.com/testforum/index.php
Thanks for any advice you might have for me. :)
Your post is still being found useful..... of course ;-)
Thanks for posting this........ it's just what I've been looking for!!!!