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

HTML Basic
สำหรับนักพัฒนาเว็บไซต์มือใหม่ HTML , CSS และการใช้ Tools ต่างๆ ในการพัฒนาเว็บไซต์

Moderator: mindphp

13asicallstar
PHP Newbie
PHP Newbie
โพสต์: 4
ลงทะเบียนเมื่อ: 13/01/2012 1:24 am

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

โพสต์ที่ยังไม่ได้อ่าน โดย 13asicallstar »

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

อันนี้หน้าแรก หน้าเริ่มต้น มันลิงค์ publice.html มัน height="400px" แต่พอลิงค์ไปอีกหน้านึง มันสูง 800px อ่ะคับ มันก็ ขนาดไม่ได้ก็จะขาดครึ่ง พอจะมีวิธีเขียนแบบไหน ที่มันลิงค์ไปหน้าไหนก็ปรับขนาดความสูงตามหน้านั้นบ้างไหมคับ ขอบคุณมากนะคับ ^^
[email protected]
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

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

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

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

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

<!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>

ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
13asicallstar
PHP Newbie
PHP Newbie
โพสต์: 4
ลงทะเบียนเมื่อ: 13/01/2012 1:24 am

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

โพสต์ที่ยังไม่ได้อ่าน โดย 13asicallstar »

<!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
ขอบคุณนะคับ
khemchicken
PHP Newbie
PHP Newbie
โพสต์: 3
ลงทะเบียนเมื่อ: 17/01/2012 4:10 pm

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

โพสต์ที่ยังไม่ได้อ่าน โดย khemchicken »

เดียวผมเอาไปลองดูก่อน
กฏและข้อควรปฏิบัติในการใช้งาน
https://www.mindphp.com/forums/viewtopic.php?f=6&t=6393
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 77