...678 Posted February 26, 2007 Share Posted February 26, 2007 Ok.Im making a website, and im using iframesbut i dont know how to make it so that if you click the link on the navigation, the iFrame changes to that pageCan anyone help? Link to comment Share on other sites More sharing options...
sickporsche Posted February 26, 2007 Share Posted February 26, 2007 Hmm, not sure what you asking, but I have a few links that you can look at, it may close up the question, here you go.http://www.htmlcodetutorial.com/frames/_IFRAME.htmlhttp://www.dyn-web.com/dhtml/iframes/ Link to comment Share on other sites More sharing options...
vytas Posted February 26, 2007 Share Posted February 26, 2007 Well you could use JavaScript. <script type="text/javascript">function changeFrame(){ document.getElementById('iframe1').src="NEW LOCATION"}</script><a href="java script:changeFrame()">The link</a><iframe src="SOME URL"id="iframe1"></iframe> Link to comment Share on other sites More sharing options...
sickporsche Posted February 26, 2007 Share Posted February 26, 2007 To be honest, Generally, frames ###### (just my 2 cents )I'd suggest not using frames, if you can. Frames will soon be outdated and replaced by table designs and table-less designs (CSS). If you wish to really excel in the field of web design; choosing a CSS based path would be my opinion in where to go. Link to comment Share on other sites More sharing options...
...678 Posted February 26, 2007 Author Share Posted February 26, 2007 Well you could use JavaScript.<script type="text/javascript">function changeFrame(){ document.getElementById('iframe1').src="NEW LOCATION"}</script><a href="java script:changeFrame()">The link</a><iframe src="SOME URL"id="iframe1"></iframe> With that code, where do i put the link that it changes to?AlsoIll try and explain better.On the site there is the navigation, and the content shows in an iFrame in a different section. So I want to be able to click the link on the navigation and the iFrame changes to the content that that link would showWhat are table designs?If you could post a link that would help alot Link to comment Share on other sites More sharing options...
jesh Posted February 26, 2007 Share Posted February 26, 2007 A much simpler method would be to use the target attribute in your links and a name attribute in the iframe: <iframe name="MyFrame" src="default.asp"></iframe><ul><li><a href="http://www.w3schools.com/" target="MyFrame">W3 Schools</a></li><li><a href="http://www.google.com/" target="MyFrame">Google</a></li></ul> Link to comment Share on other sites More sharing options...
...678 Posted March 1, 2007 Author Share Posted March 1, 2007 A much simpler method would be to use the target attribute in your links and a name attribute in the iframe:<iframe name="MyFrame" src="default.asp"></iframe><ul><li><a href="http://www.w3schools.com/" target="MyFrame">W3 Schools</a></li><li><a href="http://www.google.com/" target="MyFrame">Google</a></li></ul> Thanks for thatit works Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now