HTML ผมลิงค์ iframe อยากให้มันเปลี่ยนความสูง ตามหน้าที่ลิงค์ไปอ่ะคับ

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: HTML ผมลิงค์ iframe อยากให้มันเปลี่ยนความสูง ตามหน้าที่ลิงค์ไปอ่ะคับ

Re: HTML ผมลิงค์ iframe อยากให้มันเปลี่ยนความสูง ตามหน้าที่ลิงค์ไปอ่ะคับ

โดย khemchicken » 17/01/2012 4:27 pm

เดียวผมเอาไปลองดูก่อน

Re: HTML ผมลิงค์ iframe อยากให้มันเปลี่ยนความสูง ตามหน้าที่ลิงค์ไปอ่ะคับ

โดย 13asicallstar » 14/01/2012 2:26 am

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>VNP</title>
<link rel="stylesheet" type="text/css" href="css/Page1.css" />

<style>



</style>
<script type="text/javascript">
<!--//
function sizeFrame() {
var F = document.getElementById("myFrame");
if(F.contentDocument) {
F.height = F.contentDocument.documentElement.scrollHeight+30; //FF 3.0.11, Opera 9.63, and Chrome
} else {



F.height = F.contentWindow.document.body.scrollHeight+30; //IE6, IE7 and Chrome

}

}

window.onload=sizeFrame;

//-->
</script>

</head>

<body>
<div id="bg-head">
<div id="bg">
<div id="head-bg"> <a href="index.html">หน้าแรก</a> <a href="service.html">บริการ</a> <a href="A.htm" target="See">ชำระเงิน</a>
<a href="admin.html">ติดต่อเรา</a> <a href="item.htnl">สินค้าแนะนำ</a> <a href="pro.html">โปรโมชั่น</a> </div>
</div>
</div>

<div id="bg">
<div id="left-menu">
<div id="toper-menu"><center><b>เครื่องปรับอากาศ</b></center></div>
<div id="center-menu">
<a href="MITSUBISHI ELECTRIC.html">MITSUBISHI ELECTRIC</a>
<br><a href="MITSUBISHI HEAVY DUTY.html">MITSUBISHI HEAVY DUTY</a>
<br><a href="PANASONIC.html">PANASONIC</a>
<br><a href="SAIJO DENKI.html">SAIJO DENKI</a>
<br><a href="SAMSUNG.html">SAMSUNG</a>
<br><a href="TOSHIBA.html">TOSHIBA</a>
<br><a href="SHARP.html">SHARP</a>
<br><a href="CARRIER.html">CARRIER</a>
<br><a href="LG.html">LG</a>
<br><a href="AMENA.html">AMENA</a>
<br><a href="TRANE.html">TRANE</a>
<br><a href="CENTRAL AIR.html">CENTRAL AIR</a>
<br><a href="DAIKIN.html">DAIKIN</a>

</div>
<div id="bottom-menu"></div>
</div>

<div id="bg-body">
<div id="top-body"></div>
<div id="center-body">
<iframe name="See" id="myFrame" width="100%" src="thispage.htm" scrolling="no" frameborder="0">
An iframe capable browser is
required to view this web site.
</iframe>

</div>
<div id="bottom-body"></div>
</div>



</div>
<div id="boster"></div>

</body>
</html>

ผมไม่รู้ว่าผมเอาไปใส่ผิด อะไรหรือเปล่านะคับพอผมเปิดมาลองใช่มะ มันกะยังเป็นเหมือนเดิม T T
ขอบคุณนะคับ

Re: HTML ผมลิงค์ iframe อยากให้มันเปลี่ยนความสูง ตามหน้าที่ลิงค์ไปอ่ะคับ

โดย mindphp » 13/01/2012 10:32 am

ลองดูตามนี้ครับ

โค้ด: เลือกทั้งหมด

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ปรับขนาดความสูงอัตโนมัต</title>
<style>



</style>
<script type="text/javascript">
<!--//
function sizeFrame() {
var F = document.getElementById("myFrame");
if(F.contentDocument) {
F.height = F.contentDocument.documentElement.scrollHeight+30; //FF 3.0.11, Opera 9.63, and Chrome
} else {



F.height = F.contentWindow.document.body.scrollHeight+30; //IE6, IE7 and Chrome

}

}

window.onload=sizeFrame;

//-->
</script>
</head>
<body>


<iframe width="100%" id="myFrame" src="thispage.htm" scrolling="no" frameborder="0">
An iframe capable browser is
required to view this web site.
</iframe>
</body>
</html>

HTML ผมลิงค์ iframe อยากให้มันเปลี่ยนความสูง ตามหน้าที่ลิงค์ไปอ่ะคับ

โดย 13asicallstar » 13/01/2012 1:30 am

<iframe name="index" src="publice.html" width="560px" scrolling="no" frameborder="0"></iframe>

อันนี้หน้าแรก หน้าเริ่มต้น มันลิงค์ publice.html มัน height="400px" แต่พอลิงค์ไปอีกหน้านึง มันสูง 800px อ่ะคับ มันก็ ขนาดไม่ได้ก็จะขาดครึ่ง พอจะมีวิธีเขียนแบบไหน ที่มันลิงค์ไปหน้าไหนก็ปรับขนาดความสูงตามหน้านั้นบ้างไหมคับ ขอบคุณมากนะคับ ^^
[email protected]

ข้างบน