0

誰かが私に何が間違っているのか教えてもらえますか?メニューがクリックされたときにナビゲーションとロゴが上に移動するようにしようとしています。次に、ナビゲーションの新しい位置の下にコンテンツを表示します。私は単にmarginTopの値を変更することによってこれを行っています。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
       <title>****</title>
    <link href="design/style.css" rel="stylesheet" type="text/css"/>




</head>
<body>
    <div id="headingBlock" style="margin-top:140px;">
    <div id="logo">
    <a href="index.html"> <img src="design/images/pmb_logo.png" alt="****"/>
    </a>
    </div>
    </div>

<div id="navStrip">
    <div id="navBlock">
    <div id="nav">
        <a href="index.html" id="midPage">Home</a>
        <a href="#" class="topPage">Our Homes</a>
        <a href="#" class="topPage">Displays</a>
        <a href="#" class="topPage">Where we build</a>
        <a href="#" class="topPage">Why PMB?</a>
        <a href="#" class="topPage">Style</a>
        <a href="#" class="topPage">Contact Us</a>
     </div>
    </div>
</div>

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript"> 

$(function(){
    $(".topPage").click(function(){
        $("#headingBlock").animate({
            'marginTop': "-=140px", "slow"});

});
$("#midPage").click(function(){
     $("#headingBlock").animate({
        'marginTop': "=150px"});
});
});

</script>

<p>
</p>


<div id="mainContainer" style="visibility:hidden">

<div class="mainContent"> 

<p> Lorem Ipsum is simply dummy text of the printing and typesetting industry.</br> 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </br>
when an unknown printer took a galley of type and scrambled it to make a type </br>
specimen book. It has survived not only five centuries, but also the leap into </br>
electronic typesetting, remaining essentially unchanged. It was popularised in the </br>
1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more </br>
recently with desktop publishing software like Aldus PageMaker including versions of </br>
Lorem Ipsum. </p>



<p> Lorem Ipsum is simply dummy text of the printing and typesetting industry.</br> 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </br>
when an unknown printer took a galley of type and scrambled it to make a type </br>
specimen book. It has survived not only five centuries, but also the leap into </br>
electronic typesetting, remaining essentially unchanged. It was popularised in the </br>
1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more </br>
recently with desktop publishing software like Aldus PageMaker including versions of </br>
Lorem Ipsum. </p>

</div>
<div id="imgHome"> <img src="design/images/builders.png" alt="Builders"/> 
</div>
</div>

<div id="footer">

<h1> Designed by <a href="http://www.AYLWARD-DESIGN.COM" > Aylward Design </a> </h1>

</div>

</body>

4

1 に答える 1

0

'marginTop': "-=140px", "slow"});に変更'marginTop': "-=140px"}, "slow");

$(".topPage").click(function(){
    $("#headingBlock").animate({
        'marginTop': "-=140px"}, "slow");
});
于 2012-10-30T02:57:38.843 に答える