GORAGOD.com
freelance, web developer, web designer, hosting, domain name
Home
Host & Domain
Portfolio
อยากถามเกี่ยวกับ iFrame
Home
Forum
อยากถามเกี่ยวกับ iFrame
GMOdern
อยากจะกำหนด ขนาดความสูงของ iFrame ให้มัน auto ตาม Page หน้าที่เราจะวางอ่ะครับ
เช่น...หน้าสูง 200px ก้ให้ iFrame แสดง 200px รึว่า หน้าสูง 300px ก้ให้ iFrame แสดง 300px
ขอบคุณครับ
srenon
ความกว้าง กำหนด เป็น 100% เหมือน ตารางได้ ครับ สำหรับสูง ไม่แน่ใจ
goragod
ต้องใช้ Javascript ครับ
Penthai [PHP]
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 ;
}
ความคิดเห็น
รายละเอียด
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^
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 ;
}