Javascript-форум (https://javascript.ru/forum/)
-   Internet Explorer (https://javascript.ru/forum/css-html-internet-explorer/)
-   -   Разрешение экрана (https://javascript.ru/forum/css-html-internet-explorer/15315-razreshenie-ehkrana.html)

Golovastik 21.02.2011 19:44

Разрешение экрана
 
Возникла необходимость при разрешении экрана шириной меньше 800, уменьшить размер видео.пробую так, не срабатывает почему-то.
<script type="text/javascript">
alert();
if(screen.width<=800)
{
 document.write('
 <div align="center">
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/4CQr9vb-MLs?fs=1&amp;hl=ru_RU"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4CQr9vb-MLs?fs=1&amp;hl=ru_RU" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
</div>');
} else
{
  document.write('
  <div align="center">
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/4CQr9vb-MLs?fs=1&amp;hl=ru_RU"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4CQr9vb-MLs?fs=1&amp;hl=ru_RU" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="686" height="551"></embed></object>
</div>');
}
</script>

walik 21.02.2011 20:28

function get_ww() {
	var frameWidth=800; 
	if (self.innerWidth) 
		frameWidth = self.innerWidth; 
	else if (document.documentElement && document.documentElement.clientWidth) 
		frameWidth = document.documentElement.clientWidth; 
	else if (document.body) 
		frameWidth = document.body.clientWidth; 
	return frameWidth; 
} 

function get_wh() {
	var frameHeight=640; 
	if (self.innerHeight) 
		frameHeight = self.innerHeight; 
	else if (document.documentElement && document.documentElement.clientHeight) 
		frameHeight = document.documentElement.clientHeight; 
	else if (document.body) 
		frameHeight = document.body.clientHeight; 
	return frameHeight; 
}


Часовой пояс GMT +3, время: 02:09.