0

画像をクリックすると、プロジェクトのテキストが表示されるように見えますが、ヘッダーが複製され、[ポートフォリオに戻る] ボタンとヘッダー ボタンが機能していないように見えます。

「ポートフォリオ」ページに戻ると、プロジェクトのテキストがまだ表示されています。

http://www.janinejauvel.com/test/

html

<li style="height:393px;" data-src="http://www.janinejauvel.com/wp-content/uploads/2012/09/editorial-1-rwd-magazine.png">
<span class="cover" style="width:308px;height:0px;background-image:url('http://www.janinejauvel.com/wp-content/uploads/2012/09/bg-white.png')"></span>
<hgroup style="width:308px;height:393px;background-image:url('http://www.janinejauvel.com/wp-content/uploads/2012/09/bg-white.png')" data-project="test/dirty-fashion">
                        <div>
                            <h3>Editorial I</h3>
                            <span class="dash">&mdash;</span>
                            <p>RWD Magazine</p>
                        </div>
                    </hgroup>
                </li>

script.js

// load the project into the slideshow container div
                $('#slideshow-container').load('' + $hgroup.attr('data-project'), function() {
                    // bind slideshow
                        slideshow.render();
                        $('section#work').css('margin-top', '0px');
                });

            });


$(document).ready(function() {

    hattie.init();
    hattie.clickEvents();
    hattie.loadImages();

});

$(window).resize(function() {

    // get the currently active project, if there is one

    if ($('#slideshow').length > 0) {


        var activeProject   = $('#slideshow').attr('class');

        // trigger click
        $('hgroup[data-project="'+ activeProject + '"]').trigger('click');

    }


});
4

2 に答える 2

0

load を呼び出すと、そのヘッダー要素を含む div に HTML ページ全体が読み込まれるためです。

読み込んでいるページの内容を見てください: http://www.janinejauvel.com/test/dirty-fashion

コンテンツが欲しいだけです。ページ フラグメントのロードを調べます。

于 2012-09-10T20:48:35.077 に答える
0

変更してみてください:

$('#slideshow-container').load('' + $hgroup.attr('data-project'), function() {

に:

$('#slideshow-container').load('' + $hgroup.attr('data-project') + ' #content', function() {

これにより、URL のコンテンツ div が $hgroup.attr('data-project') に読み込まれます。

于 2012-09-10T21:03:34.190 に答える