Avatar billede sodamnsweet Nybegynder
17. december 2007 - 10:37 Der er 7 kommentarer og
1 løsning

Åbne to links på en gang

Jeg sidder med en side, hvor jeg har lavet to iframes. I toppen har jeg min menu i tekst. Når jeg så klikker på f.eks. udlejning, så skal der åbne to forskellige sider i min iframes på en gang - jeg ved at det kan lade sig gøre, måske med nogle behaviors, men jeg har simpelthen glem hvordan.

Tusinde tak :)
Avatar billede jkampmann Nybegynder
17. december 2007 - 10:41 #1
<a href="http://google.dk" onclick="window.open('http://jaykay.dk');">LINK</a>
Avatar billede di8leva Nybegynder
17. december 2007 - 10:50 #2
Nja... er det ikke mer sådan her han vil ha?

<html>
<a href="http://www.google.com" target="one" onclick="frames['two'].location.href='http://www.gmail.com';">Click the link</a><br>
<iframe name="one" src="http://www.gmail.com" style="width: 800px; height: 300px; border: #000000 solid 1px;"></iframe>
<iframe name="two" src="http://www.google.com" style="width: 800px; height: 300px; border: #000000 solid 1px;"></iframe>
</html>
Avatar billede sodamnsweet Nybegynder
17. december 2007 - 11:21 #3
Hej det er ligesom jkampmann skriver.. meeen den skal åbne siderne i to iframes der f.eks hedder _frame1 og _frame2 - Kan det puttes på?
Avatar billede jkampmann Nybegynder
17. december 2007 - 11:32 #4
Sæt "id" på din frame.
<frame id="_frame1" ....>
<iframe id="_frame2"...>

Derfor lav en javascript funktion..

<script type="text/javascript">
function OpenMyLinks( site1, site2 )
{
    var frame1 = "_frame1"; // navnet på frame1
    var frame2 = "_frame2"; // navnet på frame2


    if ( document.getElementById(frame1) && document.getElementById(frame2) )
    {
        document.getElementById(frame1).src = site1;
        document.getElementById(frame2).src = site2;
    } else {
        alert("Kunne ikke finde frames!");
        return false;
    }
}
</script>

-- og link:
<a href="#" onclick="new OpenMyLinks('http://eksperten.dk', 'http://google.dk');">LINK!</a>
Avatar billede sodamnsweet Nybegynder
17. december 2007 - 12:04 #5
Ikke forstået... gider du sætte det ind i min kode?
----------------

<html>
<head>
<title>hp</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000">
<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td>
      <table id="Ta01" width="875" height="690" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="7"> <img src="billeder/img.gif" width="874" height="115" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="115" alt=""></td>
        </tr>
        <tr>
          <td colspan="7"> <img src="billeder/img-03.gif" width="874" height="4" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="4" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3"> <img src="billeder/img-04.gif" width="24" height="76" alt=""></td>
          <td rowspan="8"> <img src="billeder/img-05.gif" width="11" height="571" alt=""></td>
          <td colspan="3" height="51" bgcolor="BCBCBC">
            <div align="center" class="brod"><b class="overskrift"><font size="2">Forsiden
              | Venteliste | Boliger |</font></b></div>
          </td>
          <td rowspan="8"> <img src="billeder/img-07.gif" width="9" height="571" alt=""></td>
          <td rowspan="3"> <img src="billeder/img-08.gif" width="25" height="76" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="51" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3"> <img src="billeder/hp_08.gif" width="206" height="36" alt=""></td>
          <td> <img src="billeder/hp_09.gif" width="581" height="17" alt=""></td>
          <td rowspan="7"> <img src="billeder/img-11.gif" width="18" height="520" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="17" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"> <img src="billeder/hp_11.gif" width="581" height="19" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="8" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2" background="billeder/img-13.gif">&nbsp; </td>
          <td rowspan="2" background="billeder/img-14.gif">&nbsp; </td>
          <td> <img src="billeder/spacer.gif" width="1" height="11" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2" width="206" height="356" valign="top"><iframe src="menuer/venstremenu/start.htm" name="_sidemenu" frameborder="0" framespacing="0" height="356" width="206" SCROLLING="hidden"></iframe></td>
          <td rowspan="3" width="581" height="424"><iframe src="next.htm" name="_framen" frameborder="0" framespacing="0" height="424" width="581" SCROLLING="hidden"></iframe></td>
          <td> <img src="billeder/spacer.gif" width="1" height="295" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3" background="billeder/img-17.gif">&nbsp; </td>
          <td rowspan="3" background="billeder/img-18.gif">&nbsp; </td>
          <td> <img src="billeder/spacer.gif" width="1" height="61" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"> <img src="billeder/img-19.gif" width="206" height="128" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="68" alt=""></td>
        </tr>
        <tr>
          <td> <img src="billeder/img-20.gif" width="581" height="60" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="60" alt=""></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
Avatar billede jkampmann Nybegynder
17. december 2007 - 16:34 #6
<html>
<head>
<title>hp</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css">

<script type="text/javascript">
/** made by www.jaykay.dk **/
function OpenMyLinks( site1, site2 )
{
    var frame1 = "_sidemenu"; // navnet på frame1
    var frame2 = "_framen"; // navnet på frame2


    if ( document.getElementById(frame1) && document.getElementById(frame2) )
    {
        document.getElementById(frame1).src = site1;
        document.getElementById(frame2).src = site2;
    } else {
        alert("Kunne ikke finde frames!");
        return false;
    }
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000">
<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td>
      <table id="Ta01" width="875" height="690" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="7"> <img src="billeder/img.gif" width="874" height="115" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="115" alt=""></td>
        </tr>
        <tr>
          <td colspan="7"> <img src="billeder/img-03.gif" width="874" height="4" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="4" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3"> <img src="billeder/img-04.gif" width="24" height="76" alt=""></td>
          <td rowspan="8"> <img src="billeder/img-05.gif" width="11" height="571" alt=""></td>
          <td colspan="3" height="51" bgcolor="BCBCBC">
            <div align="center" class="brod"><b class="overskrift"><font size="2">Forsiden
              | Venteliste | Boliger |</font></b></div>
          </td>
          <td rowspan="8"> <img src="billeder/img-07.gif" width="9" height="571" alt=""></td>
          <td rowspan="3"> <img src="billeder/img-08.gif" width="25" height="76" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="51" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3"> <img src="billeder/hp_08.gif" width="206" height="36" alt=""></td>
          <td> <img src="billeder/hp_09.gif" width="581" height="17" alt=""></td>
          <td rowspan="7"> <img src="billeder/img-11.gif" width="18" height="520" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="17" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"> <img src="billeder/hp_11.gif" width="581" height="19" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="8" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2" background="billeder/img-13.gif">&nbsp; </td>
          <td rowspan="2" background="billeder/img-14.gif">&nbsp; </td>
          <td> <img src="billeder/spacer.gif" width="1" height="11" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2" width="206" height="356" valign="top"><iframe src="menuer/venstremenu/start.htm" name="_sidemenu" frameborder="0" framespacing="0" height="356" width="206" SCROLLING="hidden"></iframe></td>
          <td rowspan="3" width="581" height="424"><iframe src="next.htm" name="_framen" frameborder="0" framespacing="0" height="424" width="581" SCROLLING="hidden"></iframe></td>
          <td> <img src="billeder/spacer.gif" width="1" height="295" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3" background="billeder/img-17.gif">&nbsp; </td>
          <td rowspan="3" background="billeder/img-18.gif">&nbsp; </td>
          <td> <img src="billeder/spacer.gif" width="1" height="61" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"> <img src="billeder/img-19.gif" width="206" height="128" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="68" alt=""></td>
        </tr>
        <tr>
          <td> <img src="billeder/img-20.gif" width="581" height="60" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="60" alt=""></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>


-- og når du laver et link:
<a href="#" onclick="new OpenMyLinks('http://eksperten.dk', 'http://google.dk');">LINK!</a>
Avatar billede sodamnsweet Nybegynder
18. december 2007 - 08:10 #7
Hej jkampmann

Det er rigtigt nok at den håber to sider på en gang, men de skal åbne i mine iframes...
Avatar billede jkampmann Nybegynder
18. december 2007 - 20:30 #8
<html>
<head>
<title>hp</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css">

<script type="text/javascript">
/** made by www.jaykay.dk **/
function OpenMyLinks( site1, site2 )
{
    var frame1 = "sidemenu"; // navnet på frame1
    var frame2 = "framen"; // navnet på frame2


    if ( document.getElementById(frame1) && document.getElementById(frame2) )
    {
        document.getElementById(frame1).src = site1;
        document.getElementById(frame2).src = site2;
    } else {
        alert("Kunne ikke finde frames!");
        return false;
    }
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000">
<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td>
      <table id="Ta01" width="875" height="690" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="7"> <img src="billeder/img.gif" width="874" height="115" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="115" alt=""></td>
        </tr>
        <tr>
          <td colspan="7"> <img src="billeder/img-03.gif" width="874" height="4" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="4" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3"> <img src="billeder/img-04.gif" width="24" height="76" alt=""></td>
          <td rowspan="8"> <img src="billeder/img-05.gif" width="11" height="571" alt=""></td>
          <td colspan="3" height="51" bgcolor="BCBCBC">
            <div align="center" class="brod"><b class="overskrift"><font size="2">Forsiden
              | Venteliste | Boliger |</font></b></div>
          </td>
          <td rowspan="8"> <img src="billeder/img-07.gif" width="9" height="571" alt=""></td>
          <td rowspan="3"> <img src="billeder/img-08.gif" width="25" height="76" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="51" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3"> <img src="billeder/hp_08.gif" width="206" height="36" alt=""></td>
          <td> <img src="billeder/hp_09.gif" width="581" height="17" alt=""></td>
          <td rowspan="7"> <img src="billeder/img-11.gif" width="18" height="520" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="17" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"> <img src="billeder/hp_11.gif" width="581" height="19" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="8" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2" background="billeder/img-13.gif">&nbsp; </td>
          <td rowspan="2" background="billeder/img-14.gif">&nbsp; </td>
          <td> <img src="billeder/spacer.gif" width="1" height="11" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2" width="206" height="356" valign="top"><iframe src="menuer/venstremenu/start.htm" id="sidemenu" name="_sidemenu" frameborder="0" framespacing="0" height="356" width="206" SCROLLING="hidden"></iframe></td>
          <td rowspan="3" width="581" height="424"><iframe id="framen" src="next.htm" name="_framen" frameborder="0" framespacing="0" height="424" width="581" SCROLLING="hidden"></iframe></td>
          <td> <img src="billeder/spacer.gif" width="1" height="295" alt=""></td>
        </tr>
        <tr>
          <td rowspan="3" background="billeder/img-17.gif">&nbsp; </td>
          <td rowspan="3" background="billeder/img-18.gif">&nbsp; </td>
          <td> <img src="billeder/spacer.gif" width="1" height="61" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"> <img src="billeder/img-19.gif" width="206" height="128" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="68" alt=""></td>
        </tr>
        <tr>
          <td> <img src="billeder/img-20.gif" width="581" height="60" alt=""></td>
          <td> <img src="billeder/spacer.gif" width="1" height="60" alt=""></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>


-- og når du laver et link:
<a href="#" onclick="new OpenMyLinks('http://eksperten.dk', 'http://google.dk');">LINK!</a>
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
Kurser inden for grundlæggende programmering

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