Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 10-17-2006, 11:37 PM   #1 (permalink)
Inactive
 
Join Date: 10-17-06
Location: Sweden
Posts: 2
iTrader: 0 / 0%
Latest Blog:
None

littlebitweird is liked by many
Need help with linking on a site with iframe

I'm making a new website now, but I have one problem. I have built the site so that the content opens in an iframe. So I have a menu to the left, and then the links in the menu leads to the iframe.
However, the menu is rather long, so when I scroll down on the page and click on a link, it opens in the iframe, but the site is still scrolled down.
Is there any possibility to make the index page scroll up to top at the same time as the link/page opens in the iframe?
I need to know this before I create too many of the pages that are going to be included.
I want to create a website that is easy to update - not having the menu on each and every one of the pages, because then it takes ages to update the menu...

The site will look something like this, though I will host it at another place later to avoid those ads...
http://medlem.spray.se/hanson/3/en/index.html
No links are working, unfortunately... But if I click on a link, it opens in the iframe, but the site stays scrolled down... And that's what I need help with avoiding.
littlebitweird is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 10-18-2006, 03:55 PM   #2 (permalink)
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
You're talking about 2 location indicators with one click? Script it.

i.e.
Click 1 = Relocate the source of the iframe to a menu item's source
Click 1 = ALSO relocate the main page (around the iframe) to its #top

Code:
<a href="somemenuitem.html" target="iframeNAME" onclick="top.location.href='#top'">Menu Item</a>
This begs the question: Why use an iframe at all? In essence, you want the main page to start at the #top each time, but change the content of one particular area of that page ... so why not just wrap the changing content in identical headers and footers? You're losing the value of the menu/iframe concept if you need to re-scroll to the top with each menu click. Its effect is the same as loading a new page, and once the first page has loaded into the browser's cache, loading a complete page in will take about the same time as loading changing content into an iframe.

You can still use the iframe for its independent scrolling action, but there's no need to get script-tricky, really.
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-18-2006, 04:46 PM   #3 (permalink)
Inactive
 
Join Date: 10-17-06
Location: Sweden
Posts: 2
iTrader: 0 / 0%
Latest Blog:
None

littlebitweird is liked by many
Thank you for your help! Though I solved it in another way than I was thinking of at first - with a bit of php coding (which I have never used before). So now the site works exactly as I want it to!
littlebitweird is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-18-2006, 07:22 PM   #4 (permalink)
v7n Mentor
 
DaveyBoy's Avatar
 
Join Date: 10-13-03
Location: England.
Posts: 6,183
iTrader: 0 / 0%
Latest Blog:
None

DaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest orderDaveyBoy is a web professional of the highest order
yeah, PHP includes would work to stop you having to update every page.
DaveyBoy is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-19-2006, 05:21 AM   #5 (permalink)
Contributing Member
 
Bernard's Avatar
 
Join Date: 02-20-04
Location: Friendswood, TX
Posts: 461
iTrader: 0 / 0%
Bernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to allBernard is a name known to all
Quote:
Originally Posted by littlebitweird View Post
I want to create a website that is easy to update - not having the menu on each and every one of the pages, because then it takes ages to update the menu...
If you are using PHP, it is very easy to put the menu in a single file and include it on individual pages. When you want to update the menu, you only need to do it one time. The same process can apply to headers and footers.


Ummm... Like DaveyBoy suggested above....
__________________
gardening ~ epilepsy
Bernard is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking buttons to an iframe Brian M Coding Forum 5 11-07-2006 12:47 PM
Error when linking to a site suzjor Coding Forum 14 10-03-2006 07:30 AM
Wy de-value a site for linking to another? Johan007 Google Forum 14 12-03-2003 02:39 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:37 PM.
© Copyright 2008 V7 Inc

Click Here