/    Sign up×
Community /Pin to ProfileBookmark

Problem with 2 iframes

I have 2 problems.

I have a page (index.php) with 2 iframes (‘mainContent’ and ‘dialogue’).

1st: I want to refresh ‘dialogue’ iframe when I click a link to ‘mainContent’ (if posible with onclick function)

2nd: I want to change height and visible-invisible properties in the ‘dialogue’ iframe again with onclick function if it is posible.

Thank you very match.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@KorOct 19.2006 — Your iframes have names or ids? Anyway, give your iframes ids and try:

<i>
</i>&lt;script type="text/javascript"&gt;
function refreshIframe(){
document.getElementById('mainContent').contentWindow.location.reload(true);
}
function changeProperties(vis,h){
var ifr=document.getElementById('dialogue);
ifr.style.visibiliy=vis;
ifr.style.height=h+'px';
}
&lt;/script&gt;
Copy linkTweet thisAlerts:
@aetocauthorOct 19.2006 — The ids and names are the same.

id="mainContent" name="mainContent"

id="dialogue" name="dialogue"

Where I will put the code to the index or in the iframes?

Sorry but I have a small problem with javascript :-)
Copy linkTweet thisAlerts:
@KorOct 19.2006 — In the index, as you said.

you may put the code where you like in the index, it dose not matter. Usually in the HEAD, for a better management and in order to separate the content.

The functions should be called [B]onclick[/B]
×

Success!

Help @aetoc 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...