视差滚动效果

所属分类:导航,其他-其他导航,杂项

 34598  350  查看评论 (2)
分享到微信朋友圈
X
视差滚动效果 ie兼容10

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.

相关插件-其他导航,杂项

CSS3侧边响应卡片式导航

CSS3侧边响应卡片式导航
  其他导航
 42840  523

圆形的动画导航用CSS和jQuery

一个实验性的全屏导航、动画使用CSS和jQuery,扩大在一个循环。 支持所有主流浏览器。
  其他导航
 36038  399

H5响应式菜单导航

H5页面自适应,响应式菜单导航
  其他导航
 50093  317

jQuery仿微信自定义菜单

jQuery仿微信自定义菜单全屏自适应手机底部弹出菜单
  其他导航
 33882  378

讨论这个项目(2)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

    junyi5d 0
    2019/4/29 15:29:40
    没看出来视差前后距离感 回复
    隐士湖 0
    2015/10/22 11:10:06

    效果还可以,需要研究程序

    回复
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
取消回复