欢迎光临一流素材网,免积分免费素材下载!
AD
当前位置:首页 > JS代码 > 相册图集

视差滚动效果

所属栏目:相册图集更新时间:2016-08-02原作者:不详发布者:deepdfhy浏览:0
基本信息
  • 发布者:
  • 原作者:不详
  • 来源:不详
  • 版权声明

The meat and potatoes. Invoking these will move that page in from that side.

parallax.bar.left(); //Bar slides in from the left

parallax.foo.top(); //bringing back foo from the top

parallax.bar.bottom(IAmBack()); //We got callbacks too ;)

functon IAmBack(){

alert("I'm back foo!");

}

# Show and Hide

Sometimes we don't need the fanciness. Show and hide simply bring pages to focus instantly, or hides them.

//All pages start out hidden,

//remember to show your initial page!

parallax.foo.show();

parallax.bar.hide(); //Bar is being a tad shy

# Last and Current

Parallax.js has two special pages that it fills in for you. You can use that just like regular pages.

parallax.bar.left()

parallax.current.ackbar(); //Bar thinks it's a trap!

parallax.foo.top();

parallax.current.ackbar(); //Foo now thinks it's a trap

parallax.last.right(); //Bar slides in from the right

# OnLoad and Preload

Sometimes your page just has to run some code when it hits the big screen. We understand. Preload runs before the page animation, onload runs after.

parallax.bar.onload = function(){

alert( "sweetest function eva!");

};

parallax.bar.left(); //Fires that function!

parallax.bar.show(); //Also fires it, how cool!

//parallax itself has it's own preload and onload functions

parallax.preload = function(){

//these get run on -every- page,

//in addition to the page's onload/preload functions

alert("Super annoying alert");

};

# Protips!

//Remember parallax can be aliased!

p = parallax;

//Using arrow key navigation is super cool

//most users find it very intuitive

$(document).keydown(function(e){

if (e.keyCode == 37) { //this is the left key,

p.bar.left();

}

}); //check out the code of this demo, it has arrow key navigation!

//For reference; 38 - top, 39 - right, 40 - bottom

//Before using .last either check to see if it's null

if(typeof p.last === 'undefined'){

//handle it here

}

//or set it before hand

p.last = p.foo;

//Movement callbacks and .onload look like they do the same thing

//But they don't!

p.bar.onload = herp();

p.bar.left(derp()); //both herp and derp get run

p.current.show() //only herp gets run

Godspeed.


具体效果请看演示,一流资源网推荐下载。

标签:
代码下载
本站下载
收藏 0 有帮助 1 没帮助 0
请站长喝杯咖啡?

站长一直坚持白天工作、晚上熬夜更新素材,付出了巨大的精力和时间,其中的辛酸难以言述。

如果本站素材对你有用,不妨考虑请站长喝杯咖啡鼓励一下!

立即打赏 0
给个评价吧
最受欢迎的

1原生js MagicZoom.商品放大镜插件商城图片放大镜效果代码

2移动端手机站图片横向拖动查看JS代码

3jquery产品图片相册插件

4jQuery zoom图片弹出层展示插件

5jQuery商品图片放大镜效果_图片相册放大镜代码

6jquery不规则美观照片墙代码

7jquery优秀的无限加载瀑布流图片展示代码

8非常漂亮的Jquery全屏动态照片墙代码

9jquery图集浏览插件相册看图插件

10Jquery全页照片墙画廊代码

最新更新的

1jQuery仿京东商品相册放大镜特效代码

2jquery优秀的无限加载瀑布流图片展示代码

3TiltViewer-3D图片浏览器代码

4非常漂亮的Jquery全屏动态照片墙代码

5JS图片旋转特效代码

6一款不错的凌乱JS照片墙相册代码

7移动端手机站图片横向拖动查看JS代码

8jQuery仿360浏览器导航栏

9CSS3手风琴图片展示