<b>REGISTER</b>

GFX-Sector - HTML, CSS


 
GFX-Sector » Coding Area » Webentwicklung » HTML, CSS » JavaScript - height problem » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Recommend to a Friend | Add Thread to Favorites

HTML, CSS

Einfache Scriptsprachen und deren Layout mit HTML und CSS
Post New Thread Post Reply

JavaScript - height problem

     Deutsche Version  English version
Author
Post « Previous Thread | Next Thread »

firefighter
Fingerwischer


Avatar von firefighter

Registration Date: 20.01.2009
Posts: 34
Program: Photoshop CS4 Extendend

Spacer
JavaScript - height problem

JavaScript - height problem

      

Hi Leute
ich hab mich mal wieder an eine Homepage gesetzt, weil die Lösung, die ich da hatte, nicht wirklich die beste war und joar ...

habe irgendwo einen denkfehler o.O

HTML:
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
    function Fensterhoehe () 
    {
          if (window.innerHeight) 
        {
            return window.innerHeight;
          } 
        else if (document.body && document.body.offsetHeight) 
        {
               return document.body.offsetHeight;
         }

    }
    Hoehe Fensterhoehe();
</script>
<link rel="stylesheet" media="screen" type="text/css" title="Style" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
</head>


<body>
<script type="text/javascript" language="JavaScript">
    <!--
        if(Hoehe> 2000)
        {
            document.getElementById('content').style.height = Hoehe + 'px';
        }
        else
        {
            document.getElementById('content').style.height ='2000px'
        }
    //-->
</script>
<div id="content">
    <div id="cont">
    <div id="header">
        <div id="banner">
            <div id="linkin">
                <a class="impressum" href="impressum.html">Impressum</a> | 
                <a class="impressum"  href="kontakt.html">Kontakt</a>
            </div>
        </div>
        <div id="platzfueller">
        </div>
        <div id="logo">
        </div>
    </div>

        <div id="text">



            <p>&nbsp;</p>
            <p align="center" class="Überschrift">    <strong>Herzlich Willkommen</strong></p>    
            <p align="center">&nbsp;</p>
            <p align="left" class="Text">Du willst einen Führerschein jetzt oder in der nächsten Zeit machen? Dann bist du hier genau Richtig!</p>
            <p align="left" class="Text">&nbsp;</p>
            <p align="left" class="Text">Was wird dir bei uns geboten?</p>
            <p align="left" class="Text">- Professionelle Ausbildung in den Klassen M, A1 , A, B und BE</p>
            <div id="portrait"></p><img src="bilder/portrait.jpg" width="265" height="303" alt="portrait" /></p> </div>
            <p align="left" class="Text">- 2x Die Woche Theorieunterricht (Di. und Do. zwischen 19:00 und 20:30)
            <p align="left" class="Text">- Termine für Sonderunterricht nach Absprache

            <p align="left" class="Text">- Ein Ansprechpartner!
            <p align="left" class="Text">
            <p align="left" class="Text">&nbsp;</p>
            <p align="left" class="Text">Wir besitzen 5 Schullungsfahrzeuge und einen Anhänger.</p>
            <p align="left" class="Text">Für die Klasse B und BE wird der Tiguan verwendet</p>
            <p align="left" class="Text">Für die Klasse M ein Peugeot Speedfight 2</p>
            <p align="left" class="Text">Für die Klasse A1 eine Kawasaki KMX 125</p>
            <p align="left" class="Text">Für die Klasse A Beschränkt eine Suzuki GS 500 E</p>
            <p align="left" class="Text">Für die Klasse A Direkt eine Suzuki GSR 600 (mit ABS)</p>
            <p align="left" class="Text">Für BE wird zusätzlich ein Kofferanhänger benutzt.</p>

            <p align="left" class="Text">Wenn ihr interesse Habt, kommt doch einfach mal vorbei.</p>
            <p align="left" class="Text">&nbsp;</p>
            <p align="left" class="Text">&nbsp;</p>
            <p align="left" class="Text">&nbsp;</p>
            <p align="left" class="Text">&nbsp;</p>
            <p align="left" class="Text">TEST TEST</p>
            <p align="left" class="Text">TEST TEST</p>
            <p><span class="Text">TEST TEST</span>
            <span class="Text">TEST TEST</span>
            <span class="Text">TEST TEST</span>
            <span class="Text">TEST TEST</span>
            <span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span>v</p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span></p>
            <p><span class="Text">TEST TEST</span></p>
              <p><span class="Text">TEST TEST</span></p>
             <p>v</p>
              <p><span class="Text">TEST TEST</span></p>
              <p><span class="Text">TEST TEST</span></p>
 

        </div>
        <div id="nav">
            <p>.</p>
            <p></p>
            <p></p>
            <p></p>
                <ul id="navi">
                <li id="home">
                    <a href="index.html" title="home">&lt;</a>
                </li>
                <li id="klassen">
                    <a href="klassen.html" title="klassen">&lt;</a>
                </li>
                <li id="ab17">
                    <a href="ab17.html" title="AB17">&lt;</a>
                </li>
                <li id="profil">
                    <a href="profil.html" title="profil">&lt;</a>
                </li>
                <li id="kontakt">
                    <a href="kontakt.html" title="Kontakt">&lt;</a></li>
            </ul>
        </div>
    </div>
</div>
</body>

</html>


CSS:


php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
@import url('css-reset.css');
@import url('typography.css');
@import url('navigation.css');

body {
    background-color#d4d4d4;
    margin0;
    padding0;
    /* [disabled]height: 100%; */
    #content{
    width:1000px;
    positionrelavive;
    margin-leftauto;
    margin-rightauto;
    height500px;
    }

div#header {
     background-color#404040;
     height230px;
     width1000px;
    }



div#banner{
    backgroundurl(img/banner.png);
    height230px;
    width1000px;
    floatright;
    }

div#platzfueller{
    height50px;
    width260px;
    margin-left30px;
}
    
div#logo{
    backgroundurl(img/logo.pngno-repeat;
    height150px;
    width260px;
    margin-left70px;
    positionrelative;
    } 
div#linkin
{
    text-alignright;
    height50px;
    width300px;
    colorwhite;
    floatright;
    margin-right10px;
}
div#nav{
    positioninherit;
    width165px;
    height100%;
    background-color#ff5a00;
    text-indent: -9000px;
    }
    
div#text{
    width820px;
    floatright;
    }
    
div#portrait
{
    floatright;
    margin-right200px;
}
div#cont{
    width:1000px;
    margin-leftauto;
    margin-rightauto;
    height100%;
    }



Ein bestimmtes div soll halt eine bestimmte höhe haben von 2000px. Wenn jedoch jemand mit einer auflösung von über 2000px auf die Homepage kommt, so soll automatisch die höhe bei der des Broserfensters liegen.
Eigentlich sollte es so klappen, wie ich es gemacht habe, oder?

(Bitte nur Tipps und nicht sowas wie: das ist vollkommen quatsch das brauch man nicht so machen. Ich will einfach nur wissen, wo mein fehler liegt)

Danke schonmal
Mit freundlichen Grüßen
firefighter


E:
Keiner eine idee?

E:von bpr:
Titel geaendert, da er nicht aussagekraeftig war.









Erste sig Zunge raus

This post has been edited 2 time(s), it was last edited by firefighter: 02.12.2010 12:49.

JavaScript - height problem 30.11.2010 10:50 firefighter is offline Search for Posts by firefighter

Azraél Azraél is a male
Scharfzeichner


Avatar von Azraél

Registration Date: 21.09.2008
Posts: 139
Location: (Alten)bochum
Program: Creative Suite 5

Spacer
      

Es gibt Monitore mit 3200x2400(4:3) und 3840x2400(16:10) - Einzelfälle 2560×2048(5:4). Wie viele private User haben denn bitte solche Dinger?

Hier, folg der Anleitung (mit jQuery) damit klappt es bestimmt.
Verschiedene CSS für verschiedene Browsergrößen





I'm a designer, not a fucking screwdriver*
a global message for clients around the world who believe that a designer is a mere tool to execute their ugly ideas.
JavaScript - height problem 01.12.2010 14:50 Azraél is offline Homepage of Azraél Search for Posts by Azraél

firefighter
Fingerwischer


Avatar von firefighter

Registration Date: 20.01.2009
Posts: 34
Program: Photoshop CS4 Extendend

Thread Starter Thread Started by firefighter
Spacer
      

quote:
Original von Azraél
Es gibt Monitore mit 3200x2400(4:3) und 3840x2400(16:10) - Einzelfälle 2560×2048(5:4). Wie viele private User haben denn bitte solche Dinger?

Hier, folg der Anleitung (mit jQuery) damit klappt es bestimmt.
Verschiedene CSS für verschiedene Browsergrößen


Ja, die 2000 war nur nen Test, weil der das nicht gemacht hat ^^ und ich dass dann manuell hoch schauben wollte ...

Danke schonmal

E:
Hab es nun etwas anders gelöst, aber es klappt endlich xD
ich lade jetzt auch im body die variablen und so ...

schauts euch einfach an Wink

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
<script type="text/javascript">
    function resize()
    {
        aktuell=  document.getElementById('text').offsetHeight;
        newsizeaktuell+230;
        
        if(window.innerHeight >newsize)
        {
            Height=window.innerHeight 230;
            
        }
        else
        {
            Height=aktuell;
        }
        document.getElementById('content').style.height Height +'px';
    }

</script>


und der body aufruf sieht nun so aus:
code:
1:
<body onload="resize()" onresize="resize()">


MfG firefighter










Erste sig Zunge raus

This post has been edited 1 time(s), it was last edited by firefighter: 01.12.2010 15:44.

JavaScript - height problem 01.12.2010 15:07 firefighter is offline Search for Posts by firefighter
 
Spacer
   
GFX-Sector
unregistered


 hat kein Avatar


Spacer

Have you enjoyed this topic?


If you were enjoying this post and if you keen on reading more interesting stuff then do not hesitate to complete the free sign up.

After the free registration you will gain access to all areas and you will be able to communicate with other artists from all over the world.

In addition you will benefit from our Photoshop and coding section as well as from our huge (hundreds of gigabytes) free resource section where you can find everything you will need to be a successful (web) designer/artist.

Sign up now and enjoy the advantages as a registered member.

(This website will be ad-free after a complete free sign up.)

New Post 01.12.2010 15:07  
Tree Structure | Board Structure
Post New Thread Post Reply
GFX-Sector » Coding Area » Webentwicklung » HTML, CSS » JavaScript - height problem

Similar topics to JavaScript - height problem
Thread
MySpace problem (Forum: HTML, CSS)
Problem mit meiner Seite (Forum: Andere Programmiersprachen)
[Frage] [Suche] und [Problem] Smugde (Forum: Fragen & Probleme)
Problem mit Firefox und Java (Forum: Allgemeine Diskussion)
MouseOver Problem! (Forum: HTML, CSS)