Avatar billede iver25 Nybegynder
30. august 2001 - 10:25 Der er 2 kommentarer og
1 løsning

Flere sider med et link

Jeg har en side med rammer. Ved at trykke på et link, skal jeg have skiftet side i to af rammerne. Hvordan gør jeg det?
Avatar billede otis Nybegynder
30. august 2001 - 10:27 #1
Avatar billede hoejrup Nybegynder
30. august 2001 - 10:28 #2
<A HREF=\"#\" onClick=\"parent.twoFrames(\'pageone1.htm\',\'pageone2.htm\')\">Page One</A>

What this line does is create \"Page One\" as a hyperlink. When \"Page One\" is clicked on the JavaScript function called \"twoFrames\" is called, and two page names are passed to the \"twoFrames\" function (\"pageonn1.htm\" and \"pageone2.htm\"). The \"#\" for the HREF
is just a dummy reference that doesn\'t really do anything and is only there as a means to help build the hyperlink. Pay special attention to the order and placement of the single and double quotation marks. This order is important, and if one is misplaced, your
JavaScript function will not work.

Creating the JavaScript Function:
The final step is to create the \"twoFrames\" JavaScript function that actually does all the work and is called when you click on the link. The \"twoFrames\" function would look something like the following, and would be placed in the HEAD section of the page that
builds your framesets:

<SCRIPT LANGUAGE=\"JavaScript\">
<!-- //Hide from older browsers

var leftFrame=null
var rightFrame=null

function twoFrames(leftFrame,rightFrame) {
parent.frames[0].location.href = leftFrame;
parent.frames[1].location.href = rightFrame;
}
// end hiding -->
</SCRIPT>

/per
Avatar billede otis Nybegynder
30. august 2001 - 10:31 #3
takker :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester