Click to See Complete Forum and Search --> : parameters


havik
02-04-2003, 04:24 PM
I've seen this done in applets and I was just wondering if there were anyway it could be done in Javascript. If not, then could someone please direct me to the proper information.

The following is my entire code for a scroller I have, the rest is in .js files (as you can see). What I would like to know is there anyway to allow anyone to enter parameters from here (such as background images or even text and images to scroll) other than going into the .js files and altering them there?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<HEAD>
<title></title>

<!-- Insert this tag into the header -->
<script language="JavaScript" src="javas/initializeScroller.js">
</script>

</head>

<!-- IMPORTANT TO LOAD THE FUNCTION "LoadFuncs()" HERE!!!!! -->
<body onLoad = "LoadFuncs()">

<!-- example that you can have the scroller anywhere you wish now -->
<table align="center" border="2"><tr><td>

<!-- Insert this script to where you want it -->
<script language = "JavaScript1.2" src="javas/scroller.js">
</script>

</td></tr></table>
</body>
</html>

khalidali63
02-04-2003, 06:41 PM
Its difficult to assume that which approach the code writer has taken,but surely in the
javas/initializeScroller.js
file the text or the parameters are set.
Look for a function or for the varaibles that constitute the scrollers message/images

then in the head section below the
javas/initializeScroller.js
call
create another block of script and in this block give those variables values you wish.

cheers

Khalid

havik
02-05-2003, 09:13 AM
K, thanks

I'll give it a shot and report back later.

Havik

havik
02-05-2003, 10:52 AM
Well, I got it to work, and this is how (for anyone interested). It's not pretty but it works.

Anyone have any ideas of how I can have a separate text file that I can scroll, as of right now the content to be scrolled is located within document.write tags, which isn't very user friendly.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<HEAD>
<title></title>

<script language="JavaScript" src="javas/initializeScroller.js">
</script>

</head>


<body onLoad = "LoadFuncs()">


<script language = "JavaScript1.2">

var pixels = 1;

var viewBoxHeight = 160;

var viewBoxWidth = 150;

var scrollBoxHeight = 160;

var scrollBoxWidth = viewBoxWidth - 30;

var defaultScrollSpeed = 50;

var scrollBG = "";

var font_color = "black";

var buttonBG = "white";

var border = "0";

var bordercolor = "white";

</script>
<script language = "Javascript1.2" src="javas/scroller.js">
</script>

</body>
</html>