zoukankan      html  css  js  c++  java
  • query实现图片上下左右翻滚效果代码

    文章来给大空介绍基于jquery的animate方法实现的一个图片上下左右翻滚效果代码,下面我来给大家发我早上整的jquery实现图片显示上下左右翻滚实例代码,各位朋友可进入参考。
    
    
     我们先来看看核心代码
    
    
    复制代码
    
    
    
    
    $(document).ready(function(){
     $(".top div a").hover(function(){
      $("img",this).stop().animate({top:"-56px"},{queue:false,duration:200});
     },function(){
      $("img",this).stop().animate({top:"0px"},{queue:false,duration:200});
     });
     
     $(".bottom div a").hover(function(){
      $("img",this).stop().animate({left:"-122px"},{queue:false,duration:200});
     },function(){
      $("img",this).stop().animate({left:"0px"},{queue:false,duration:200});
     });
    })
     
    
    
    具体的实例演示代码
    
    
    
     代码如
    
    
    
    
    
    <style type="text/css">
    body{margin:0 auto;font:12px/1.5 tahoma,arial,5b8b4f53;color:#828282;background:#fff}
    body,div,p,span,a,ul,li,b,form,input,h2,h3,img{margin:0;padding:0}
    ul,li{list-style-type: none}
    img{border:none;}
    
    .top{500px;margin:20px auto}
     .top div{122px;height:56px;float:left;margin-left:5px;display:inline;border:1px #ccc solid;position:relative;overflow:hidden}
      .top div img{position:absolute}
    .bottom{500px;margin:20px auto}  
     .bottom div{122px;height:56px;float:left;margin-left:5px;display:inline;border:1px #ccc solid;position:relative;overflow:hidden}
      .bottom div img{position:absolute} 
    </style>
    
    <div class="top">
     <div><a href="http://www.php100.com/"  target="_blank" rel="nofollow"><img src="images/shu.jpg" /></a></div>
    </div>
    
    <div class="bottom">
     <div><a href="http://www.hzhuti.com/" target="_blank" rel="nofollow"><img src="images/heng.jpg" /></a></div>
    </div>
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
     $(".top div a").hover(function(){
      $("img",this).stop().animate({top:"-56px"},{queue:false,duration:200});
     },function(){
      $("img",this).stop().animate({top:"0px"},{queue:false,duration:200});
     });
     
     $(".bottom div a").hover(function(){
      $("img",this).stop().animate({left:"-122px"},{queue:false,duration:200});
     },function(){
      $("img",this).stop().animate({left:"0px"},{queue:false,duration:200});
     });
    })
    </script>
     
  • 相关阅读:
    wdcp升级php和mysql
    centos安装中文支持(转)
    centos5.5用phpstudy一键安装配置虚拟主机后,yum配置代理服务器squid
    http status 汇总
    关于html标签元素的data-*属性
    [分 享] PHPCMS V9 更换域名,附件地址无法批更新(更换变便)问题>解决方法!!
    svn服务器配置小记
    Camstar Portal modeling user guid --设置本地时间
    msdn webcast 下载地址整理
    mvc 项目下 webservice 程序无法运行
  • 原文地址:https://www.cnblogs.com/wenson/p/3322328.html
Copyright © 2011-2022 走看看