我試圖創建兩個框架,並使它們滾動到一起, 例如在頁面頂部更改菜單欄的情況下 - 我正在使用傳送帶 - 或頁腳在底部, 必須顯示爲頁面的一部分。兩個框架一個滾動條
我希望頁面看起來像一個頁面,它也能夠滾動,但頁面實際上由兩個框架組成。 使用這個......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Info from: http://www.webxpertz.net/forums/showthread.php?t=257 -->
<!-- Using this... -->
<meta NAME="Description" content="Outer frame(OneBaredFrame) used to wrap the header and body frames" />
<meta HTTP-EQUIV="Cache-Control" content="no-cache" />
<meta HTTP-EQUIV="pragma" content="no-cache" />
<title></title>
</head>
<frameset rows="1,*" border="0" frameborder="no">
<frame src="javascript:<HTML></HTML>" name="dummy" id="dummy"
frameborder="no" marginheight="0" marginwidth="0" noresize="noresize" scrolling="no"></frame>
<frame src="index_inner.html" name="OneBaredFrame"
id="OneBaredFrame" frameborder="no" marginheight="0" marginwidth="0" noresize="noresize" scrolling="yes"></frame>
<!-- the bottom frame above if scrolling="yes" doesn't show a scrollbar for me? -->
<!-- the top frame above if scrolling="yes" does show a scrollbar for me if rows="100,*" say? -->
</frameset>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta NAME="Description" content="Frames for within a scrollable frame">
<meta HTTP-EQUIV="Cache-Control" content="no-cache">
<meta HTTP-EQUIV="pragma" content="no-cache">
<title></title>
</head>
<!-- My header and body frames need to scroll together,
so I am using another frameset (the one above) to enclose these frames -->
<frameset rows="215,*" border="0" frameborder="no">
<frame src="Header.html" id="header" name="header" frameborder="no"
marginheight="0" marginwidth="0" noresize="noresize" scrolling="no"></frame>
<frame src="index_body.html" id ="body" name="body" frameborder="no"
marginheight="0" marginwidth="0" noresize="noresize" scrolling="no"></frame>
<!-- when the above are set to scrolling="yes" scrollbars appear for me for each -->
</frameset>
</html>
詢問代碼的主體(作爲註釋)是一個非常糟糕的做法。問問題,發佈代碼 - 更多的人會閱讀它。這次我會爲你解決這個問題。 – Oded 2010-11-21 11:23:17
問題是什麼? – khachik 2010-11-21 11:23:18
感謝Oded的幫助,花了我很長時間來嘗試發佈我所做的。 – Carpenter 2010-11-21 11:31:09