/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] ~~2 FRAME Interactivity~~

Is there a way for content on one frame of the page to interact with another frame on the page?

can the link in the other frame do the same job as the link in the same frame:

one frame:

[QUOTE]

<html>

<head>
<script>
var interval0 = setInterval(“change(1,0,0);”,4000);
var interval1 = setInterval(“change(0,1,0);”,3000);
var interval2 = setInterval(“change(0,0,1);”,2000);

function change(x,y,z) {
var reduce = new Array(x,y,z);
var field = new Array();
for (i = 0; i < 3; i++) {
field[i] = document.getElementById(“i”+i);

var temp = Number(field[i].value)+reduce[i];

if(temp >= 0 && temp <= 20) // only assign new value if 0 or greater and 20 or less
field[i].value = temp;
//else
// do nothing

}

}

function clear(x,y,z) {
var inital = new Array(x,y,z);
for (i = 0; i < 3; i++) {
var a = document.getElementById(“i”+i);
a.value = inital[i];
}
}

</script>
</head>

<body onload=”clear(10,10,10);”>

<form>
Gold: <input type=”text” value=”10″ id=”i0″ readonly />
Lumber: <input type=”text” value=”10″ id=”i1″ readonly />
Stone: <input type=”text” value=”10″ id=”i2″ readonly />
<input type=”button” value=”Reduce (5,5,5)” id=”reduce” onclick=”change(-5,-5,-5)” />
</form>

</body>

</html>

[/QUOTE]

second frame:

[QUOTE]

<a href=”#” id=”reduce” onclick=”change(-5,-5,-5)” />Reduce (5,5,5)</a>

[/QUOTE]

if anyone knows about frames please help, thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JAug 09.2007 — The link in the second frame would be something like this

<a href="#null" onclick="parent.framename.change(-5,-5,-5)" />Reduce (5,5,5)</a>

where framename is the name of the target frame
Copy linkTweet thisAlerts:
@mitchellauthorAug 09.2007 — could you tell me the code of how to make the 2 frames(one at the top and one below)
Copy linkTweet thisAlerts:
@Mr_JAug 09.2007 — <frameset rows ="25%, 75%">

<frame src="page1.htm" name="topframe">

<frame src="page2.htm" name="bottomframe">

</frameset>
Copy linkTweet thisAlerts:
@mitchellauthorAug 09.2007 — thanks Mr J
×

Success!

Help @mitchell spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...