0
我有以下兩個媒體查詢如何模擬orientationchange獲取css數據?
@media screen and (orientation : portrait) {
.rect {width:100px;}
}
@media screen and (orientation : landscape) {
.rect {width:200px;}
}
當我啓動index.php
我需要兩個變量即刻例如
var rect_portrait = width // when orientation is portrait (100 px)
var rect_landscape = width // when orientation is landscape (200 px)
如何實現?預先感謝您
landscape_width = portrait_height; landscape_height = portrait_width; – Andrew
安德魯原諒我的低jQuery技能,但我怎樣才能使用您提供的解決方案? –