Annonceindlæg fra itavis
04. februar 2009 - 20:15
#3
Har prøvet dette af men det virker ikke... den skrive samme højde lige meget hvad <!-- var viewportwidth; var viewportheight; // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth, viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } alert('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>'); //--> <!-- Hide from non-JS browsers var scnWid,scnHei; if (self.innerHeight) // all except Explorer { scnWid = self.innerWidth; scnHei = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode { scnWid = document.documentElement.clientWidth; scnHei = document.documentElement.clientHeight; } else if (document.body) // other Explorers { scnWid = document.body.clientWidth; scnHei = document.body.clientHeight; } alert('<p>Your inner width is '+scnWid+'x'+scnHei+'</p>'); // -->
04. februar 2009 - 22:38
#4
<ole> <script type="text/javascript"> window.onload = function(){ var viewportwidth; var viewportheight; // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth, viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } alert('Your viewport is '+viewportwidth+'x'+viewportheight+' pixels'); var sBodyWidth = document.body.offsetWidth; var sBodyHeight = document.body.offsetHeight; alert('Your body element is '+sBodyWidth+'x'+sBodyHeight+' pixels'); } </script> /mvh </bole>