อยากจะกำหนด ขนาดความสูงของ iFrame ให้มัน auto ตาม Page หน้าที่เราจะวางอ่ะครับ
เช่น...หน้าสูง 200px ก้ให้ iFrame แสดง 200px รึว่า หน้าสูง 300px ก้ให้ iFrame แสดง 300px
ขอบคุณครับ
เช่น...หน้าสูง 200px ก้ให้ iFrame แสดง 200px รึว่า หน้าสูง 300px ก้ให้ iFrame แสดง 300px
ขอบคุณครับ
ความกว้าง กำหนด เป็น 100% เหมือน ตารางได้ ครับ สำหรับสูง ไม่แน่ใจ
ต้องใช้ Javascript ครับ
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 ;
}
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 ;
}