2016-05-06 18 views
0

Ich habe eine .Top div mit variabler Höhe, und ich möchte .Nav unter dem .Top div positionieren, so ich möchte etwas wie .Nav-Top = .Top-Höhe. Wie kann man das in jQuery machen?Positionierung Div unter Top div

.nav { 
    display:none; 
    width:100%; 
    height:100%; 
    right:0; 
    top:80px; 
    position:absolute; 
    background: #1581C4; 
    padding-top:10px; 
    padding-bottom:10px; 
    z-index:6; 
} 
.top { 
    content:url(../images/top480.jpg); 
    z-index:0; 
    border-bottom:1px solid #000000; 
    width:100%; 
} 
+0

Was meinst du mit '.nav-top = nav-height' ?? Und bitte posten Sie auch Ihren HTML-Code. –

+0

Ich meine. Nav Top =. Top-Höhe ... – Trupe

Antwort

0

Ich denke Javascript einen Versuch wert ist:

<script type="text/javascript"> 

    window.onload=function{ 
     document.getElementById([yournavdivid]).style.top = document.getElementById([yourtopivid]); 
    } 
</script>