- <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
- <script type="text/javascript">
- // 品牌翻转
- var turn = function(target,time,opts){
- target.find('a').hover(function(){
- $(this).find('img').stop().animate(opts[0],time,function(){
- $(this).hide().next().show();
- $(this).next().animate(opts[1],time);
- });
- },function(){
- $(this).find('.info').animate(opts[0],time,function(){
- $(this).hide().prev().show();
- $(this).prev().animate(opts[1],time);
- });
- });
- }
- var verticalOpts = [{'width':0},{'width':'180px'}];
- turn($('#vertical'),100,verticalOpts);
- var horizontalOpts = [{'height':0,'top':'120px'},{'height':'240px','top':0}];
- turn($('#horizontal'),100,horizontalOpts);
- </script>
来源: http://www.qdfuns.com/article/44121/afe3e6de6a6aae3eb8dd6cbb33a39da6.html