0

序文: 恥ずかしながらこういうの苦手です

わかりましたので、divでJparallaxを使用したいのですが、うまくいきません。デモが動作するようになったら修正しますが、今のところそこまで到達することさえできます. demo から #parallax の css をコピーし、.js を head にリンクし、スクリプトをコピーして #parallax を head で有効にしましたが、その div が何らかの理由で有効になりません。

私のhtml

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Portal</title>
<link href='http://fonts.googleapis.com/css?family=Jura:400,300,500,600'rel='stylesheet' type='text/css'>
<link href="portalcss.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="dropdown.css" type="text/css" />
<script type="text/javascript" src="jquery.jparallax.js"></script>
<script type="text/javascript" src="dropdown.js"></script>
<script type="text/javascript">
window.onload = maxWindow;

function maxWindow() {
    window.moveTo(0, 0);


    if (document.all) {
        top.window.resizeTo(screen.availWidth, screen.availHeight);
    }

    else if (document.layers || document.getElementById) {
        if (top.window.outerHeight < screen.availHeight || top.window.outerWidth <   screen.availWidth) {
            top.window.outerHeight = screen.availHeight;
            top.window.outerWidth = screen.availWidth;
        }
    }
}

</script> 

<script type="text/javascript">
<!--

// jQuery.noConflict();

// RUN

var corners = '<img src="images/corner_dark_tl.png" class="tl" />'+
                        '<img     src="images/corner_dark_tr.png" class="tr" />'+
                        '<img src="images/corner_dark_bl.png" class="bl" />'+
                        '<img src="images/corner_dark_br.png" class="br" />';

jQuery(document).ready(function(){

jQuery('h1').html('<img src="images/logo_stephband_grey.png" />');

jQuery('#parallax').jparallax().append(corners);

});

//-->
</script>
</head> 



<body>
<div id="parallax">
<img src="0.png" alt="" style="width:978px; height:325px;"/>
<img src="1.png" alt="" style="width:987px; height:328px;"/>
<img src="2.png" alt="" style="width:1001px; height:333px;"/>
<img src="3.png" alt="" style="width:1031px; height:343px;"/>
<img src="4.png" alt="" style="width:1067px; height:355px;"/>
<img src="5.png" alt="" style="width:1120px; height:373px;"/>
<img src="6.png" alt="" style="width:1200px; height:400px;"/>
</div>

そして、これがそのための私のcssです #

#parallax
{
background:#2f3134;
position:relative;
overflow:hidden;
width:60em;
height:300px;
margin:1.5em 0;
}

これはすべて、このデモから直接切り取ったものですこのデモ どんな助けも大歓迎です

4

1 に答える 1

0

彼がデモで持っているように、これをヘッダーに追加します。

<script type="text/javascript" src="jquery.min-1.2.6.js"></script>

残念ながら、少し古いバージョンのjqueryを使用する必要があることが別の古い質問でわかったようですが、それは別の問題です。

于 2011-11-07T01:20:14.733 に答える