Jump to content
  • 0

Height из % в px


Chebas
 Share

Question

3 answers to this question

Recommended Posts

  • 0

Может быть вы это имели ввиду:

<script type="text/javascript">
function alertSize() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
dfg = document.getElementById("ght")
dfg.innerHTML = 'Width = ' + myWidth + ' Height = ' + myHeight;
}
</script>

<a href="#" onclick=alertSize()>Ghgh</a>

<div id=ght></div>

Это скрипт, который позволяет определить высоту экрана в пикселах без панелей а только область прокрутки (так сказать рабочая область).

Link to comment
Share on other sites

  • 0

Нет. Я имел ввиду полностью страницу, от первого тега, до последнего. Ведь если задавать высоту в процентах (например, <div height=50%>, то берется 50% от рабочей области окна.

А вот ответ на мою задачу:

http://forum.sources.ru/index.php?showtopic=255173

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy