Toon posts:

[HTML/Javascript] met een links meerder frames vervangen

Pagina: 1
Acties:

Verwijderd

Topicstarter
Mijn site bestaat uit 4 frames:
linksboven, rechtsboven, linksonder, hoofd.
Nu wil met de links in het frame linksonder de inhoud van de frames linksboven en hoofd vervangen.
Met de functie beschreven in :
[rml][ javascrpt] meerdere pagina's aanroepen met 1 link[/rml]
lukt dit uitstekend echter maar met 1 link.
Mijn bedoeling is dat deze toepassing werkt voor al mijn links in het frame linksonder.

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Als je naar de code kijkt:
code:
1
2
3
4
5
6
7
8
SCRIPT LANGUAGE="JavaScript"><!--
function functionName(fileName1,fileName2) {
    parent.menu.location.href = fileName1;
    parent.main.location.href = fileName2;
}
//--></SCRIPT>

<A HREF="#" onClick="functionName('file1.html','file2.html')">Go</A>
]
Dan moet je dat toch voor elke extra pagina, je functie uitbreiden en bij elke link de functie (met de juiste pagina's) aanroepen?

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • Plecky
  • Registratie: Januari 2004
  • Niet online
BtM909 schreef op 14 september 2004 @ 14:57:
[...] voor elke extra pagina, je functie uitbreiden en bij elke link de functie (met de juiste pagina's) aanroepen?
Dat laatste wel uiteraard, maar je kan de functie gewoon hetzelfde laten (wel de namen van de target frames veranderen)

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Plecky schreef op 14 september 2004 @ 15:01:
[...]


Dat laatste wel uiteraard, maar je kan de functie gewoon hetzelfde laten (wel de namen van de target frames veranderen)
eeh nee, TS wil 4 frames wijzigen ;)

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


Verwijderd

Topicstarter
BtM909 schreef op 14 september 2004 @ 14:57:
Als je naar de code kijkt:
code:
1
2
3
4
5
6
7
8
SCRIPT LANGUAGE="JavaScript"><!--
function functionName(fileName1,fileName2) {
    parent.menu.location.href = fileName1;
    parent.main.location.href = fileName2;
}
//--></SCRIPT>

<A HREF="#" onClick="functionName('file1.html','file2.html')">Go</A>
]
Dan moet je dat toch voor elke extra pagina, je functie uitbreiden en bij elke link de functie (met de juiste pagina's) aanroepen?
Dus als ik het goed begrijp (ben een JavaScript Newbie) ziet de de code er voor een 2e link er zo uit:

code:
1
2
3
4
5
6
7
8
9
10
11
SCRIPT LANGUAGE="JavaScript"><!--
function functionName(fileName1,fileName2, fileName3, fileName3) {
    parent.menu.location.href = fileName1;
    parent.main.location.href = fileName2;
    parent.menu.location.href = fileName3;
    parent.main.location.href = fileName4;

}
//--></SCRIPT>
<A HREF="#" onClick="functionName('file1.html','file2.html')">Go</A>
<A HREF="#" onClick="functionName('file3.html','file4.html')">Go</A>

  • André
  • Registratie: Maart 2002
  • Laatst online: 18-05 16:30

André

Analytics dude

Nee :)

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script type="text/javascript">
function functionName(fileName1,fileName2)
{
  parent.menu.location.href = fileName1;
  parent.main.location.href = fileName2;
}
</script>

<a href="#" onclick="functionName('file1.html','file2.html')">Go</a>
<a href="#" onclick="functionName('file3.html','file4.html')">Go</a>
<a href="#" onclick="functionName('file5.html','file6.html')">Go</a>
<a href="#" onclick="functionName('file7.html','file8.html')">Go</a>
<a href="#" onclick="functionName('file9.html','file10.html')">Go</a>
<a href="#" onclick="functionName('file11.html','file12.html')">Go</a>

[ Voor 77% gewijzigd door André op 14-09-2004 16:04 ]


  • crisp
  • Registratie: Februari 2000
  • Nu online

crisp

Devver

Pixelated

Of helemaal generiek:
JavaScript:
1
2
3
4
5
6
function changeFrame() {

    var i = arguments.length;
    while (--i) parent.frames[arguments[i][0]].location.href = arguments[i][1];

}

HTML:
1
<a href="#" onclick="changeFrame(['menu','menu1.html'],['footer','footer1.html']);return false">bla</a>


:P

Intentionally left blank


  • Plecky
  • Registratie: Januari 2004
  • Niet online
Je kan ook een aparte frameset pagina maken voor elke combi van die 2 windows die je wil veranderen. Werkt natuurlijk alleen fijn als je niet heel veel links hebt, maar werkt wel zonder Javascript (je hebt van die mensen)
Pagina: 1