PDA

View Full Version : Quick Question



Luke
02-01-2008, 09:49 PM
Ok, is it possible so that if i click a link, two things could open in two iframes?

Thanks
Luke

Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time. :)

Blob
02-01-2008, 09:52 PM
How about something like:

<a target="hello" href="hi3.php"><a target="hello2" href="hi.php">Open</a></a>

Luke
02-01-2008, 09:59 PM
only 1 opens ;(,

Blob
02-01-2008, 10:02 PM
only 1 opens ;(,

link??

[Oli]
02-01-2008, 10:03 PM
I think you'll need javascript.

like

<a onClick="openboth();">link</a>

& then in js you open both links in their iframes

Luke
02-01-2008, 10:08 PM
http://habtown.net/Habtown_Layout_V1/testin.htm

I've set 2 pages, wen u click, only 1 changes ;(

[Oli]
02-01-2008, 10:14 PM
http://habtown.net/Habtown_Layout_V1/testin.htm

I've set 2 pages, wen u click, only 1 changes ;(

I've just tested out myself i got one working, holdon; il post it:

EDIT: okay, so in my test.html I put this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript" SRC="test.js">
</SCRIPT>
</head>

<body>

<a href="#" onclick="openboth();">link</a><br />
<br />
<iframe name="frame1" src="a.html"></iframe>
<iframe name="frame2" src="b.html"></iframe>

</body>
</html>



And in my test.js (javascript file) I put this:



function openboth(){
window.frame1.location="1.html";
window.frame2.location="2.html";
}


So you want to open 1.html & 2.html in iframes frame1 & frame2 get me ?

check, i have my test here:
http://www.2nd-design.com/test

Luke
02-01-2008, 10:23 PM
;4319610']I've just tested out myself i got one working, holdon; il post it:

EDIT: okay, so in my test.html I put this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript" SRC="test.js">
</SCRIPT>
</head>

<body>

<a href="#" onclick="openboth();">link</a><br />
<br />
<iframe name="frame1" src="a.html"></iframe>
<iframe name="frame2" src="b.html"></iframe>

</body>
</html>



And in my test.js (javascript file) I put this:



function openboth(){
window.frame1.location="1.html";
window.frame2.location="2.html";
}


So you want to open 1.html & 2.html in iframes frame1 & frame2 get me ?

check, i have my test here:
http://www.2nd-design.com/test



ahh, i see, tht's fairly simple xD

Thanks, i would +rep but spread.

Baving
03-01-2008, 12:41 AM
You could have a javascript function to open to a location:



function openlink(url,windowframe) {

window.open(url,windowframe);

}
<a href="#" onclick="openlink('http://google.co.uk','_parent');">Link me</a>

Want to hide these adverts? Register an account for free!