TXXT

新手坚持写代码,最后一定会成为老手

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
$(document).ready(function(){
    /*$('.box-mark li').mouseenter(function(){
        $(this).find('.img-text').stop().animate({'bottom':0},600)
    });
    $('.box-mark li').mouseleave(function(){
        $(this).find('.img-text').stop().animate({'bottom':'-100%'},600)
    })*/
    function Mark(li){
        this.li=li;
    }
    Mark.prototype.move=function(text){
        $(this.li).mouseenter(function(){
            $(this).find(text).stop().animate({'bottom':0},600)
        })
        $(this.li).mouseleave(function(){
            $(this).find(text).stop().animate({'bottom':'-100%'},600)
        })
    }
    var mark=new Mark('.box-mark li');
    mark.move('.img-text');
}) 

代码还有些不完善,需要继续学习

posted on 2016-09-13 14:34  TXXT  阅读(234)  评论(0编辑  收藏  举报