<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>jQuery层动画定位滑动</title>

<style type="text/css">

<!--

body {

font-family: 'Signika Negative', sans-serif;

}

#head {

z-index:10;

position:absolute;

top:0;

left:0;

width:100%;

height:30px;

border-color:#0055ff;

border-width:0 0 10px 0;

border-style:solid;

background:#0088ff;

}

#head li{

list-style:none;

float:left;

display:block;

height:30px;

padding:0 10px; 0 10px;

cursor:pointer;

font-size:26px;

}

#head li:hover{

color:#ffffff;

background:#0055ff;

border-color:#0011ff;

border-width:0 0 10px 0;

border-style:solid;

}

#box {

position:absolute;

top:0;

left:0;

width:100%;

height:100%;

overflow:hidden;

}

#bg {

position:absolute;

top:0;

left:0;

width:100%;

height:100%;

overflow:visible;

background:;

}

.cell {

width:100%;

height:100%;

overflow:auto;

}

.list {

position:absolute;

top:50%;

left:50%;

width:800px;

height:600px;

margin:-300px 0 0 -400px;

background:#0088ff;

}

#class_1 {

position:absolute;

top:0;

left:0;

background:;

}

#class_2 {

position:absolute;

top:0;

left:100%;

background:;

}

#class_3 {

position:absolute;

top:0;

left:200%;

background:;

}

#class_4 {

position:absolute;

top:100%;

left:0;

background:;

}

#class_5 {

position:absolute;

top:100%;

left:100%;

background:;

}

#class_6 {

position:absolute;

top:100%;

left:200%;

background:;

}

#class_7 {

position:absolute;

top:200%;

left:0;

background:;

}

#class_8 {

position:absolute;

top:200%;

left:100%;

background:;

}

#class_9 {

position:absolute;

top:200%;

left:200%;

background:;

}

-->

</style>

<script type="text/javascript" src="/ajaxjs/jquery-1.6.2.min.js"></script> 

<script type="text/javascript">

$(document).ready(function()

{

$("#l_01").click(function(){

$("#bg").stop().animate({top:0+"%",left:0+"%"},"slow");

});

$("#l_02").click(function(){

$("#bg").stop().animate({top:0+"%",left:-100+"%"},"slow");

});

$("#l_03").click(function(){

$("#bg").stop().animate({top:0+"%",left:-200+"%"},"slow");

});

$("#l_04").click(function(){

$("#bg").stop().animate({top:-100+"%",left:0+"%"},"slow");

});

$("#l_05").click(function(){

$("#bg").stop().animate({top:-100+"%",left:-100+"%"},"slow");

});

$("#l_06").click(function(){

$("#bg").stop().animate({top:-100+"%",left:-200+"%"},"slow");

});

$("#l_07").click(function(){

$("#bg").stop().animate({top:-200+"%",left:0+"%"},"slow");

});

$("#l_08").click(function(){

$("#bg").stop().animate({top:-200+"%",left:-100+"%"},"slow");

});

$("#l_09").click(function(){

$("#bg").stop().animate({top:-200+"%",left:-200+"%"},"slow");

});

});

</script>

</head>

<body>

    <div id="head">

<li id="l_01">1</li>

<li id="l_02">2</li>

<li id="l_03">3</li>

<li id="l_04">4</li>

<li id="l_05">5</li>

<li id="l_06">6</li>

<li id="l_07">7</li>

<li id="l_08">8</li>

<li id="l_09">9</li>

</div>

<div id="box">

   <div id="bg">

              <div class="cell" id="class_1">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_2">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_3">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_4">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_5">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_6">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_7">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_8">

                <div class="list"></div>

              </div>

              <div class="cell" id="class_9">

                <div class="list"></div>

              </div>

   </div>

</div>

<div><A href="http://www.999jiujiu.com/">http://www.999jiujiu.com/</A></div>

</body>

</html>

版权声明:本文博主原创文章。博客,未经同意不得转载。

jQuery 代码的层定位滑动动画效果的更多相关文章

  1. 使用jQuery 中的显示与隐藏动画效果实现折叠下拉菜单的收缩和展开,在页面的列表中有若干项,列表的每项中有一个二级列表,二级列表默认为隐藏状态。点击列表的项,切换二级列表的显示或隐藏状态

    查看本章节 查看作业目录 需求说明: 使用jQuery 中的显示与隐藏动画效果实现折叠下拉菜单的收缩和展开,在页面的列表中有若干项,列表的每项中有一个二级列表,二级列表默认为隐藏状态.点击列表的项,切 ...

  2. QPropertyAnimation 几行代码快速制作流畅的动画效果

    QPropertyAnimation Class 官方英文文档[点击前往] QPropertyAnimation Class 中文译文文档[点击前往]   简介 QPropertyAnimation ...

  3. jquery 显示弹出层可利用动画效果

    1 show()方法和hide()方法 $("selector").show()  从display:none还原元素默认或已设置的display属性$("selecto ...

  4. jQuery实现浮动层跟随页面滚动效果

      helloweba.com Author:月光光 Time:2010-11-29 09:02 Tag: jquery  滚动 在本文中,我将介绍一个可以跟随页面滚动的层效果,当用户滚动鼠标滚轮或者 ...

  5. jQuery的动画效果

    jQuery 是一个 JavaScript 库.jQuery 库可以通过一行简单的标记被添加到网页中. <script type="text/javascript" src= ...

  6. 【Android UI设计与开发】10:滑动菜单栏(二)SlidingMenu 动画效果的实现

    其实就是在显示菜单栏时,有个动画的效果.代码比较简单,下面进行说明. 1.效果图如下,手机上查看效果更佳 2.代码实现,这里只讲解动画效果的实现,具体代码可在源代码中查看 <1> 先定义一 ...

  7. jQuery Easing动画效果扩展(转)

    jQuery API提供了简单的动画效果如淡入淡出以及自定义动画效果,而今天我给大家分享的是一款jQuery动画效果扩展增强插件jquery.easing.js,使用该插件可以实现直线匀速运功.变加速 ...

  8. jquery动画效果中,避免持续反应用户的连续点击

    一.某些动画效果中,避免持续连续反应用户的连续点击(这标题真不好描述) 意思就是指用户点击速度很快,完成一次效果的时间不能很快结束的话,就会出现用户不点击了,效果还在持续.看下面例子就明白了,手风琴效 ...

  9. jQuery Easing 动画效果扩展

    jQuery API提供了简单的动画效果如淡入淡出以及自定义动画效果,而今天我给大家分享的是一款jQuery动画效果扩展增强插件jquery.easing.js,使用该插件可以实现直线匀速运功.变加速 ...

随机推荐

  1. Servlet(七)生成验证码

    1.ImageCode.java package com.hunhun.utils; import java.awt.Color; import java.awt.Font; import java. ...

  2. 使用WiX Toolset创建.NET程序发布Bootstrapper(安装策略管理)(二)——自定义安装

    原文:使用WiX Toolset创建.NET程序发布Bootstrapper(安装策略管理)(二)--自定义安装 自定义产品卸载方式 继续从上一次的基础上前进,现在我们已经知道了最简单的bootstr ...

  3. PropertiesDemo

    import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configurat ...

  4. zoj3329(概率dp)

    题目连接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3754 题意:有三个骰子,分别有k1,k2,k3个面. 每次掷骰子,如 ...

  5. 静态网页VS动态网页

    干<沙朗新闻发布系统>什么时候.我们已经建立的网页.html的,并且.aspx,第一次接触.我认为这些东西是一样的,因为它,在观看ASP.NET视频的时候.听见里面讲课的老师有提到了这两样 ...

  6. 【翻译】我钟爱的Visual Studio前端开发工具/扩展

    原文:[翻译]我钟爱的Visual Studio前端开发工具/扩展 怎么样让Visual Studio更好地编写HTML5, CSS3, JavaScript, jQuery,换句话说就是如何更好地做 ...

  7. zoj3209(DLX)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=16234 题意:给p张小纸片, 问能不能选出尽量少的一部分或全部数量 ...

  8. 处理json中影响解析的多余引號

    在xml中,敏感字符是尖括号,在json中,敏感字符是引號,上文中我们介绍了怎样处理xml中的敏感字符.本文说说怎样处理json中的敏感字符. 思路与上文同样,不再赘述.直接上代码: json–> ...

  9. Eclipse常用热键

    ,Ctrl+D 删除选中的几行 ,Alt+上下箭头 移动选中的代码块 ,Alt+左右箭头 回退 前进 ,Alt+Shift+上下箭头 复制选中的代码块 ,sysout+Ctrl space 生成Sys ...

  10. js 自定义方法 实现停留几秒 sleep

    function sleep(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; wh ...