|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
Join Date: Jan 2002
Location: Barcelona
Posts: 85
|
external js file and repeated function
Hi,
I would like to take the following function out of my xhtml page and link to it via an external js file. In most cases I know how to do this but this function is repeated on many pages BUT with different 'variables' (I never know the right word!). This is what I have on my pages at the moment (each using different images): Code:
function makeArray() {
this.length = makeArray.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = makeArray.arguments[i]
}
var teams = new makeArray ("images/products/boston_compact1.png", "images/products/boston_compact2.png");
var eatMe = 1;
function flipper() {
document.form.image.src = teams[eatMe];
eatMe += 1;
if (eatMe == 3) eatMe = 1;
setTimeout("flipper()", 4000);
}
Can I make them: function makeArray1() function makeArray2() function makeArray3() etc. ? Thanks for any ideas, Craig Last edited by craigtaylor74; 03-13-2005 at 07:34 AM. Reason: missing code tags |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|