2

Is there a way to use a "Before and after" image as a full sized background? Would be great i guess! I am trying to use such examples as a full page size image;

http://www.catchmyfame.com/2009/06/25/jquery-beforeafter-plugin/

http://www.queness.com/post/6480/create-an-attractive-before-and-after-photo-effect-with-jquery

But everytime i try this the second 'reveal' div doesn't size 100% to the browser borders.

Can anyone push me in the right direction?

Thanks

4

1 回答 1

0

CSS3 有这个功能 W3School CSS3 Background但这在旧浏览器中不起作用
另一种替代方法是.. 将 Main Background Image 设置为 Body 标签。创建 DIV 标签并添加此样式后:

.mydiv{
    position:absolute;
    top:0;
    bottom:0;
    width:100%;
    background-image:url('my/url.jpg');
    background-position:right top;
}

记住不要将此 div 用于内容。它只是为了保存你的 bg 图像。

于 2013-04-03T07:25:37.097 回答