Ren
Member
Registered: 16th Oct 04
User status: Offline
|
Quick question for a quick answer...
Ive created a website with frames. On the first frame, i have the html with all the links, but everytime i click a link, it loads the page in that frame. Instead i want the frame to remain static, and load in the other frame next to it. How can it be done
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Name your frames, then put a target in the link.
|
Butler
Member
Registered: 2nd Jun 05
Location: London
User status: Offline
|
add target= then either "_blank", "_self", "_parent" or "_top" to the link code (<a href ="www.corsasport.com" target="_blank" etc etc )depending on which frame you want the link to appear in
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
If you want it to load in to the frame inside the page you'll need a target that isn't any on that list.
|
Butler
Member
Registered: 2nd Jun 05
Location: London
User status: Offline
|
I think you need to rename the frame in the header and make that name the target, is that right? Use dreamweaver
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Yes, in the master document:
<frame name="rightside" src="firstpage.htm">
And in the link, which is in the page loaded in to the left side:
<a href="secondpage.htm" target="rightside">
|
Ren
Member
Registered: 16th Oct 04
User status: Offline
|
Its still not working heres my code
Main Page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/tr/html4/strict.dtd">
<HTML>
<HEAD>
</HEAD>
<frameset rows="64,*">
<frame name="top"; scrolling="no"; noresize target="contents"; src="top">
<frameset cols="150,*">
<frame name="links"; target="main"; src="links.html">
<frame name="main"; src="homepage.html">
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</HTML>
Links frame html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/tr/html4/strict.dtd">
<HTML>
<head>
<base target="main">
</head>
<body bgcolor="#FFD700">
<p><a href="homepage.htm" target="main">Homepage</a></p>
<p><a href="places_interest.html" target="main">Places of Interest</a></p>
<p><a href="town_centre.html" target="main">Town Centre</a></p>
<p><a href="night_life.html" target="main">City Night Life</a></p>
<p><a href="student_bar.html" target="main">Student Union</a></p>
<p><a href="transport.html" target="main">Transportation</a></p>
<p><a href="nus.html" target="main">NUS Offers</a></p>
<p><a href="numbers.html" target="main">Useful names and numbers</a></p>
<p><a href="contact.html" target="main">Contact Me</a></p>
</body>
</HTML>
|
Ren
Member
Registered: 16th Oct 04
User status: Offline
|
http://www.corsasport.co.uk/board/viewthread.php?tid=247911
Charlene will perform sexual favours for whoever helps me (charlene we'll talk)
|
Gavin
Premium Member
Registered: 3rd Apr 02
Location: West Midlands
User status: Offline
|
havent read it throughly... but i used javascript to do this sort stuff....
function BodyWindow(link)
{
window.open(link,"name of frame")
}
in body
<a href="javascript:BodyWindow('www.dummy.html')">clicky</a>
reason y i did it this way is cos of less maintence i.e. changing the name of the frame is simpler
[Edited on 23-11-2005 by Gavin]
pew pew pew pewwwww
|
Ren
Member
Registered: 16th Oct 04
User status: Offline
|
its gotta be html mate
|
Gavin
Premium Member
Registered: 3rd Apr 02
Location: West Midlands
User status: Offline
|
neva seen '<base target="main">' this before????
pew pew pew pewwwww
|
corsa|chris
Member
Registered: 17th Nov 05
Location: Staffordshire
User status: Offline
|
Just had a quick go, got it to work how I think you want it to.
Default names for everything, but you should be able to get the jist of it.
Index page:
quote: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="links.htm" name="leftFrame" scrolling="NO" noresize>
<frame src="link.htm" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
Links page
quote: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p><a href="link.htm" target="mainFrame">link</a></p>
<p><a href="link.htm" target="mainFrame">link</a></p>
<p><a href="link.htm" target="mainFrame">link</a></p>
<p><a href="link.htm" target="mainFrame">link</a></p>
</body>
</html>
And finally the main page, which you see on the right side first.
quote: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Some text here for the main page.
</body>
</html>
Hope you make sense of that!
|
steve101
Member
Registered: 25th Oct 04
Location: Kilmarnock, Ayrshire, Scotland
User status: Offline
|
Right, you basically have the top bar, a nested frame on the left and a main frame on the right where you want pages to be loaded?
If so, make your frameset, and put in the general code eg..
"<html>
<head>
<title>My Frameset</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="80,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.htm" name="topFrame" scrolling="NO" noresize >
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="links.htm" name="leftFrame" scrolling="NO" noresize>
<frame src="home.htm" name="mainFrame">
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>"
On your Links page you should have say...
<html>
<head>
<title>No title required here</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="hello.php" target="mainFrame">link.htm
</a>
</body>
</html>
And basically the others can have whatever you need.. eg banner at the top, and general crap in the main bit.
|
drax
Member
Registered: 5th Feb 05
Location: Sittingbourne, Kent
User status: Offline
|
Mate, how about you dont use frames and use php, or if you cant use php at least use Iframes
ill sort you out that..
|
Ren
Member
Registered: 16th Oct 04
User status: Offline
|
wooooooooooooooooooooo!!!!!!!!
|
steve101
Member
Registered: 25th Oct 04
Location: Kilmarnock, Ayrshire, Scotland
User status: Offline
|
agreed with this, frames are an absolute disaster sometimes. Php is quite friendly if used properly? Doesn't take long to learn either!
|
corsa|chris
Member
Registered: 17th Nov 05
Location: Staffordshire
User status: Offline
|
Sucess?
|
Ren
Member
Registered: 16th Oct 04
User status: Offline
|
hahahahahaha i fixed it!!! Turns out i had the page saved in two different locations, so any changes i made were all well and good, but i kept viewing the other page. n00b-ness to the max!!!! cheers everyone!
|
marklaruk
Member
Registered: 4th Sep 04
Location: Leeds
User status: Offline
|
glad i could help
|
Ren
Member
Registered: 16th Oct 04
User status: Offline
|
are you just here for charlene
|
drax
Member
Registered: 5th Feb 05
Location: Sittingbourne, Kent
User status: Offline
|
<HTML>
<HEAD>
</HEAD>
<table width="100%" border="0" align="center">
<tr>
<td align="center">
woobnly image
</td>
</tr>
</table>
<table width="100%" border="0" align="center">
<tr>
<td align="center" width="150"><br>
<a href="homepage.html" target="main">Homepage</a><br><br>
<a href="places_interest.html" target="main">Places of Interest</a><br><br>
<a href="town_centre.html" target="main">Town Centre</a><br><br>
<a href="night_life.html" target="main">City Night Life</a><br><br>
<a href="student_bar.html" target="main">Student Union</a><br><br>
<a href="transport.html" target="main">Transportation</a><br><br>
<a href="nus.html" target="main">NUS Offers</a><br><br>
<a href="numbers.html" target="main">Useful names and numbers</a><br><br>
<a href="contact.html" target="main">Contact Me</a><br><br>
</td>
<td>
<iframe src="town_centre.html" name="main" width="100%" height="100%"
frameborder="0">
Sorry, your browser doesn't support iframes.
</iframe>
</td>
</tr>
</body>
</noframes>
</frameset>
</HTML>
The above code is a rewrite of your website, but utilises iframes and tables over frames, slap that into your index page and check the links, its all set out for u to cusomise
|
drax
Member
Registered: 5th Feb 05
Location: Sittingbourne, Kent
User status: Offline
|
My way is alot less code and neater btw
|
drunkenfool
Member
Registered: 7th Feb 03
Location: Hereford Drives: Audi R8 V8
User status: Offline
|
quote: Originally posted by drax
Mate, how about you dont use frames and use php, or if you cant use php at least use Iframes
ill sort you out that..
*matts mate matt*
yep. actually i have no idea what iframes is but you should read up on div tags.
[Edited on 25-11-2005 by drunkenfool]
|