加载网站时,全屏将设为false
var fullscreen = 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上运行)