อยากถามเกี่ยวกับ iFrame

อยากจะกำหนด ขนาดความสูงของ iFrame ให้มัน auto ตาม Page หน้าที่เราจะวางอ่ะครับ

เช่น...หน้าสูง 200px ก้ให้ iFrame แสดง 200px รึว่า หน้าสูง 300px ก้ให้ iFrame แสดง 300px


ขอบคุณครับ
25 ก.ย. 2552 3 2,137

ความกว้าง กำหนด เป็น 100% เหมือน ตารางได้ ครับ สำหรับสูง ไม่แน่ใจ
#1

ต้องใช้ Javascript ครับ
#2

javascript หาความสูงคับ

function sizeHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight ;
}
#3
ความคิดเห็น
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^