PDA

View Full Version : Modifying a Script



stevan
Nov 29th, 2002, 09:45 PM
I would like to make a change to the following script so that the links that you click on to are horizonal above the text box instead of the being on the left side of the description box as it is now



2 parts to this script
==========================================================
part 1 edit your description and link in this part
=========================================================

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function CC_Display(selection) {
if (selection=="1") {
document.form.info.value="A heap of free javascripts to enhance your site!";
document.form.go.value="http://www.a1javascripts.com";
}
else if(selection=="2") {
document.form.info.value="The largest directory of free webmaster resources on the planet!";
document.form.go.value="http://www.123webmaster.com";
}
else if(selection=="3") {
document.form.info.value="A monstrous collection of free graphics!";
document.form.go.value="http://www.free-clip-images.com";
}
else if(selection=="4") {
document.form.info.value="Download tons of free Software!";
document.form.go.value="http://www.freewarefiles.com";
}
else if(selection=="5") {
document.form.info.value="25 megs of free webspace; httpcity.com/you!";
document.form.go.value="http://www.httpcity.com";
}
else if(selection=="6") {
document.form.info.value="Download free perl scripts!";
document.form.go.value="http://www.perlaccess.com/";
}
else {
document.form.info.value = "You Are Here";
document.form.go.value="http://www.a1javascripts.com";
}
}
function moreInfo() {
var page=document.form.go.value;
window.location=page;
}
// End -->
</script>
==========================================================================
Part 2 - place this part where you want your menu to show and edit the link titles
===========================================================================

<!-- --><form name=form>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="400" >
<tr>
<td ALIGN=LEFT VALIGN=TOP>
<a href="javascript:CC_Display(1);">A1 JavaScripts</a><br>
<a href="javascript:CC_Display(2);">123webmaster</a><br>
<a href="javascript:CC_Display(3);">Free-Clip_Images</a><br>

<a href="javascript:CC_Display(4);">FreewareFiles</a><br>
<a href="javascript:CC_Display(5);">HttpCity</a><br>
<a href="javascript:CC_Display(6);">PerlAccess</a></td>

<td ALIGN=CENTER VALIGN=CENTER><textarea name=info rows=6 cols=30 wrap=virtual>Click a link for more info!</textarea></td>
</tr>
</table>
<input type=button name=button value="Go There!" onClick="moreInfo()">
<input type=hidden name=go value=""></form><!-- -->


Thxs For the help
Steve

:thumbsup:

A1ien51
Nov 29th, 2002, 10:10 PM
all it is links in a table.....

Mr J
Nov 30th, 2002, 02:25 PM
Here's your table


<form name=form>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="400" >
<tr>
<td ALIGN=LEFT VALIGN=TOP>
<a href="javascript:CC_Display(1);">A1 JavaScripts</a><br>
<a href="javascript:CC_Display(2);">123webmaster</a><br>
<a href="javascript:CC_Display(3);">Free-Clip_Images</a><br>

<a href="javascript:CC_Display(4);">FreewareFiles</a><br>
<a href="javascript:CC_Display(5);">HttpCity</a><br>
<a href="javascript:CC_Display(6);">PerlAccess</a><BR>

<textarea name=info rows=6 cols=30 wrap=virtual>Click a link for more info!</textarea></td>
</tr>
</table>
<input type=button name=button value="Go There!" onClick="moreInfo()">
<input type=hidden name=go value="">
</form>

stevan
Nov 30th, 2002, 03:42 PM
First Thxs MrJ

How would i change it to look like this

Java Scripts Something Else Something ELse

Instead of


Java Scripts
Something ELse
Something ELse


Like it shows now


And is there a way to make the line that show in the box have a return without having error

else if(selection=="2") {
document.form.info.value="The largest directory of free webmaster resources on the planet!

This line would have a return between the line above";


document.form.go.value="http://www.123webmaster.com";

duniyadnd
Nov 30th, 2002, 07:14 PM
In Mr. J's script, remove the <br> tags, which basically means "break", or go to the next line. Once that is removed, all text are next to each other until it runs out of space, then automatically goes to the next line (unless the width is specified to be long enough, past the width of the screen).

Duniyadnd

Mr J
Nov 30th, 2002, 08:06 PM
Try this.....

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function CC_Display(selection) {
if (selection=="1") {
document.form.info.value="A heap of free javascripts to enhance your site!";
document.form.go.value="http://www.a1javascripts.com";
}
else if(selection=="2") {
document.form.info.value="The largest directory of free webmaster resources on the planet! \nThis line would have a return between the line above";
document.form.go.value="http://www.123webmaster.com";
}
else if(selection=="3") {
document.form.info.value="A monstrous collection of free graphics!";
document.form.go.value="http://www.free-clip-images.com";
}
else if(selection=="4") {
document.form.info.value="Download tons of free Software!";
document.form.go.value="http://www.freewarefiles.com";
}
else if(selection=="5") {
document.form.info.value="25 megs of free webspace; httpcity.com/you!";
document.form.go.value="http://www.httpcity.com";
}
else if(selection=="6") {
document.form.info.value="Download free perl scripts!";
document.form.go.value="http://www.perlaccess.com/";
}
else {
document.form.info.value = "You Are Here";
document.form.go.value="http://www.a1javascripts.com";
}
}
function moreInfo() {
var page=document.form.go.value;
window.location=page;
}
// End -->
</script>

<form name=form>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="100%" >
<tr>
<td ALIGN=LEFT VALIGN=TOP>
<a href="javascript:CC_Display(1);">A1 JavaScripts</a>
<a href="javascript:CC_Display(2);">123webmaster</a>
<a href="javascript:CC_Display(3);">Free-Clip_Images</a>

<a href="javascript:CC_Display(4);">FreewareFiles</a>
<a href="javascript:CC_Display(5);">HttpCity</a>
<a href="javascript:CC_Display(6);">PerlAccess</a><BR>

<textarea name=info rows=6 cols=30 wrap=virtual>Click a link for more info!</textarea></td>
</tr>
</table>
<input type=button name=button value="Go There!" onClick="moreInfo()">
<input type=hidden name=go value="">
</form>


This post may not have rendered correctly, if there is a space in the word javascript in the links remove the space.