我正在使用Stellar.js构建一个照片库,使图像重叠变得棘手(只是一个简单的视差效果,如上所述)。
这是链接: http://foalenraged.com/david/indexi.php
以下是我希望它的工作方式: http://markpeckmezian.com/
使用PHP生成Div:
for($i = 0; $i <= 15; $i++){
$rand = rand(1, 20);
$rand = $rand/10;
$margin = -1*(1500-($i*100));
echo '<div id="image'.$i.'" data-stellar-ratio="'.$rand.'" data-stellar-vertical-offset="'.$margin.'" style="z-index: '.$i.'; width="10%"><img src="'.$dir."/".$files[$i].'"></div>
';
}