0

サイトが読み込まれると、フルスクリーンが false に設定されます

    var fullscreen = false;

次に、フルスクリーンが true か false かに応じて、複数の div に対してさまざまなことをしたいと考えています。

        var fullscreen = false;

fullscreen.on('click', function(){
    if (fullscreen == false) {
        fullscreen = true;
        backgroundCurtain.css({"background" : "black", "padding" : "0"});
        pictureInner.css({"width": "100%"});
        fullscreen.css({"backgroundPosition" : "-26px 0"});
        pictureContainer.css({"width" : "auto", "padding" : "0"});
        imageResized.css({"maxHeight" : "100%", "maxWidth" : "100%"});
        var imageWidth = imageResized.width();
        pictureInner.css({"width" : imageWidth});
        alert(imageWidth);
    }
    else if (fullscreen == true) {
        fullscreen = false;
        backgroundCurtain.removeAttr("style").children().removeAttr("style");
    }
});

これはまったく機能しません。なぜなのかわかりませんか?

ライブ サイトでデバッグしたい場合は、サイト上の任意の画像を押してみてください。https://dl.dropbox.com/u/9677524/Webbdesign/william.html (Dropbox の公開ページにアップロードした場合、スクリプトは Chrome で動作しません)

4

0 に答える 0