小编NaO*_*aOH的帖子

全屏样式的身体元素?

我的网站应用了平铺背景图像,可以在照片背后看到它们过渡(大多数照片填充背景).看看这里:http://new.element17.com.

但是,在全屏查看时(使用Chrome/Mozilla右上角的按钮),此背景图像会消失,然后背景就会消失#fff.我该如何设计呢?

基于一些阅读,我尝试了以下内容:

body:-webkit-full-screen {background-image:url(../images/olive.jpg);}
body:-moz-full-screen {background-image:url(../images/olive.jpg);}
body:-ms-full-screen {background-image:url(../images/olive.jpg);}
body:-o-full-screen {background-image:url(../images/olive.jpg);}
body:full-screen {background-image:url(../images/olive.jpg);}
Run Code Online (Sandbox Code Playgroud)

但这不会导致任何变化.有任何想法吗?

css html5 fullscreen

9
推荐指数
1
解决办法
8760
查看次数

eval()不工作?

我试图通过PHP从图像的EXIF数据中获取焦距.

这是我到目前为止的代码:

$exif = exif_read_data("$photo");
$length10 = $exif['FocalLength'];
$length = eval($length10);
Run Code Online (Sandbox Code Playgroud)

在这种情况下,$ length10为105mm返回类似"1050/10"的东西.我不知道为什么.我想要做的就是让PHP做数学返回105.但是当我运行它时,我收到以下错误消息:

[04-Nov-2012 20:06:39] PHP Parse error:  syntax error, unexpected $end in index.php(52) : eval()'d code on line 1
Run Code Online (Sandbox Code Playgroud)

为什么?

php eval

2
推荐指数
1
解决办法
3642
查看次数

setAttribute()无效?

我正在尝试在我的网站上添加几个导航"窗格"到Shadowbox .我找到了以下一些代码,这是有效的,但依赖于相当多的内联CSS.我试图把它移到shadowbox.css,但我似乎无法让它工作.这是代码:

var cssNavButtons = {cursor:"pointer", position:"absolute", width:200, height:"100%", top:0, "z-index":400};
var navBtnRight = $("<div/>").css(cssNavButtons).css({right: 0, background:"url('images/nav-right.png') center center no-repeat"}).click(function(){Shadowbox.next();});
var navBtnLeft = $("<div/>").css(cssNavButtons).css({left: 0, background:"url('images/nav-left.png') center center no-repeat"}).click(function(){Shadowbox.previous();});
$("#sb-body-inner").prepend(navBtnRight).prepend(navBtnLeft);
Run Code Online (Sandbox Code Playgroud)

我试图将vars navBtnRight和navBtnLeft设置为使用外部CSS文件,但无济于事:

var navBtnRight = $("<div/>").setAttribute("class","sb-bignav").setAttribute("id","sb-bignav-right").click(function(){Shadowbox.next();});
Run Code Online (Sandbox Code Playgroud)

任何人都可以让我知道为什么这不起作用?谢谢!

javascript css shadowbox

0
推荐指数
1
解决办法
2786
查看次数

Can these two jQuery functions be combined into one that is more efficient?

I have two functions in jQuery to hide and then show a header, and also swap the buttons out so that when the header is hidden, the "show header" button appears, and vice versa. They are as follows:

$('#close_header').click(function() {
    $('#header').animate({ top: '-=150px' }, 500);
    $(this).toggle();
    $('#open_header').toggle();
});

$('#open_header').click(function() {
    $('#header').animate({ top: '+=150px' }, 500);
    $(this).toggle();
    $('#close_header').toggle();
});
Run Code Online (Sandbox Code Playgroud)

The markup to go along with is as follows:

<img src="images/close.png" id="close_header" class="header_control fadein button">
<img src="images/open.png" id="open_header" class="header_control fadein button">
<div …
Run Code Online (Sandbox Code Playgroud)

html jquery

0
推荐指数
1
解决办法
68
查看次数

标签 统计

css ×2

eval ×1

fullscreen ×1

html ×1

html5 ×1

javascript ×1

jquery ×1

php ×1

shadowbox ×1