html實現iframe內嵌頁面跳轉的demo

2022-03-29 17:44:57 字數 1857 閱讀 5269

記錄一下iframe內嵌頁面的跳轉方式

**:index.html:

<

html

>

<

head

>

<

title

>根目錄

title

>

<

script

>

function

changesrc1()

function

changesrc2()

script

>

head

>

<

body

>

<

div>

<

button

id="btn-sub1"

href

="1.html"

target

="iframe1"

onclick

="changesrc1()"

>切換到頁面一

button

>

<

button

id="btn-sub2"

href

="2.html"

target

="iframe1"

onclick

="changesrc2()"

>切換到頁面二

button

>

<

a href

="1.html"

target

="iframe1"

>切換到頁面一

a>

<

a href

="2.html"

target

="iframe1"

>切換到頁面二

a>

div>

<

div>

<

iframe

name

="iframe1"

id="iframe1"

src="1.html"

>

iframe

>

div>

body

>

html

>

1.html:

<

html

>

<

head

>

<

title

>根目錄

title

>

head

>

<

body

>

<

div>

<

h1>頁面一

h1>

div>

body

>

html

>

2.html:

<

html

>

<

head

>

<

title

>根目錄

title

>

head

>

<

body

>

<

div>

<

h1>頁面二

h1>

div>

body

>

html

>

三個頁面在同一資料夾內

注:target指向的是iframe的name,不是id

demo:

另:雖然這個demo很簡單,但還是感謝宿舍三哥對本萌新的點撥幫助

iframe 實現html框架

要做乙個首頁,分為上中下三頁,分別做好了三個頁面,為head.jsp,main.jsp和bottom.jsp。然後想當然用iframe去實現框架。直接用iframe 頁頭和中間的部分出現空白,去不掉。用table控制 這樣頁頭和中間的空白被去掉 頁頭上有漂移的下拉列表,內容多,比較長,這樣有部分選單...

實現 彈出iframe內嵌頁面元素全屏化

一直也沒分享有用的東西給大家,今天剛好做乙個例子,整理了一下,順便發給大家。希望多大家有幫助。彈出iframe內嵌頁面元素到父頁面並全屏化 iframe和彈窗這些詞對於js高手來說都是耳熟能詳的東西,作為乙個新人來說,還在學習階段的我就在工作中遇到這麼乙個奇葩的需求,要在引入的iframe頁面裡做乙...

jsp 內嵌網頁內容 iframe

3jflinux聯盟src 檔案的路徑,既可是html檔案,也可以是文字 asp等 3jflinux聯盟width height 畫中畫 區域的寬與高 3jflinux聯盟scrolling 當src的指定的html檔案在指定的區域不顯不完時,滾動選項,如果設定為no,則不出現滾動條 如為auto ...