(function($) { $.fn.num1 = function() { n1 = $(this).width(); h2 = $(this).height(); $(this).hover(function() { var becurr = "background:#ba8a60;position:absolute;" // top边框 var divTop = "
"; // right边框 var divRight = "
"; // Bottom边框 var divBottom = "
"; // Left边框 var divLeft = "
"; $(this).append(divTop, divRight, divBottom, divLeft); $(this).find("div:nth-child(odd)").stop().animate({ width: n1 + 3.5 }, 300); $(this).find("div:nth-child(even)").stop().animate({ height: h2 + 3.5 }, 300); }, function() { $(this).find("div:nth-child(odd)").stop().animate({ width: 0 }, 300); $(this).find("div:nth-child(even)").stop().animate({ height: 0 }, 300, function() { $(".num1 .divTop,.num1 .divRight,.num1 .divBottom,.num1 .divLeft").remove() }); }) } })(jQuery); (function($) { $.fn.num2 = function() { $(this).hover(function() { // 通用Class var becurr = "background:#F95F5F;position:absolute;border-radius:10px;opacity:0;" // top边框 var divTop = "
"; // right边框 var divRight = "
"; // Bottom边框 var divBottom = "
"; // Left边框 var divLeft = "
"; $(this).append(divTop, divRight, divBottom, divLeft); $(this).find("div:nth-child(odd)").stop().animate({ width: n1 + 3.5 }, 200); $(this).find("div:nth-child(even)").stop().animate({ height: h2 + 3.5 }, 200); }, function() { $(this).find("div:nth-child(odd)").stop().animate({ width: 0 }, 200); $(this).find("div:nth-child(even)").stop().animate({ height: 0 }, 200, function() { $(".num3 .divTop,.num3 .divRight,.num3 .divBottom,.num3 .divLeft").remove() }); }) } })(jQuery); (function($) { $.fn.num4 = function() { n1 = $(this).width(); h2 = $(this).height(); $(this).hover(function() { var becurr = "background:#ff0000;position:absolute;" // top边框 var divTop = "
"; // right边框 var divRight = "
"; // Bottom边框 var divBottom = "
"; // Left边框 var divLeft = "
"; $(this).append(divTop, divRight, divBottom, divLeft); $(this).find("div").eq(0).stop().animate({ width: n1 + 3.5 }, 200, function() { $(this).parent().find("div").eq(1).stop().animate({ height: h2 + 3.5 }, 200, function() { $(this).parent().find("div").eq(2).stop().animate({ width: n1 + 3.5 }, 200, function() { $(this).parent().find("div").eq(3).stop().animate({ height: h2 + 3.5 }, 200) }); }); }) }, function() { $(this).find("div").stop(); $(this).find("div").eq(3).stop().animate({ height: 0 }, 200, function() { $(this).parent().find("div").eq(2).stop().animate({ width: 0 }, 200, function() { $(this).parent().find("div").eq(1).stop().animate({ height: 0 }, 200, function() { $(this).parent().find("div").eq(0).stop().animate({ width: 0 }, 200, function() { $(".num4 .divTop,.num4 .divRight,.num4 .divBottom,.num4 .divLeft").remove() }) }); }); }) }) } })(jQuery); (function($) { $.fn.num5 = function() { n1 = $(this).width(); h2 = $(this).height(); $(this).hover(function() { var becurr = "background:#ba8a60;position:absolute;" // top边框 var divTop = "
"; // right边框 var divRight = "
"; // Bottom边框 var divBottom = "
"; // Left边框 var divLeft = "
"; $(this).append(divTop, divRight, divBottom, divLeft); $(this).find("div:nth-child(odd)").stop().animate({ width: n1 + 3.5 }, 300, function() { $(this).parent().find("div:nth-child(even)").stop().animate({ height: h2 + 3.5 }, 300); }); }, function() { $(this).find("div:nth-child(odd)").stop().animate({ width: 0 }, 300, function() { $(this).parent().find("div:nth-child(even)").stop().animate({ height: 0 }, 300, function() { $(".num5 .divTop,.num5 .divRight,.num5 .divBottom,.num5 .divLeft").remove() }); }); }) } })(jQuery); (function($) { $.fn.num6 = function() { n1 = $(this).width(); h2 = $(this).height(); $(this).hover(function() { var becurr = "background:#ff0000;position:absolute;" // top边框 var divTop = "
"; // right边框 var divRight = "
"; // Bottom边框 var divBottom = "
"; // Left边框 var divLeft = "
"; $(this).append(divTop, divRight, divBottom, divLeft); $(this).find("div:nth-child(odd)").stop().animate({ width: n1 + 3.5, left: -2 }, 300); $(this).find("div:nth-child(even)").stop().animate({ height: h2 + 3.5, top: -2 }, 300); }, function() { $(this).find("div:nth-child(odd)").stop().animate({ width: 0, left: n1 / 2 }, 300); $(this).find("div:nth-child(even)").stop().animate({ height: 0, top: h2 / 2 }, 300, function() { $(".num6 .divTop,.num6 .divRight,.num6 .divBottom,.num6 .divLeft").remove() }); }) } })(jQuery); (function($) { $.fn.num7 = function() { n1 = $(this).width(); h2 = $(this).height(); $(this).hover(function() { var becurr = "background:#ff0000;position:absolute;" // toplf边框 var divToplf = "
"; // Rightri边框 var divRighttop = "
"; // topri边框 var divTopri = "
"; // right边框 var divRight = "
"; // Bottom边框 var divBottom = "
"; // Left边框 var divLeft = "
"; // Leftbottom边框 var divLeftbottom = "
"; // Leftbottom边框 var divRightLeft = "
"; $(this).append(divToplf, divRighttop, divTopri, divRight, divBottom, divLeft, divLeftbottom, divRightLeft); $(this).find("div:nth-child(odd)").stop().animate({ width: n1 / 2 + 3.5 }, 300); $(this).find("div:nth-child(even)").stop().animate({ height: h2 / 2 + 3.5 }, 300); }, function() { $(this).find("div:nth-child(odd)").stop().animate({ width: 0 }, 300); $(this).find("div:nth-child(even)").stop().animate({ height: 0 }, 300, function() { $(".num7 .divToplf,.num7 .divRighttop,.num7 .divTopri,.num7 .divRight,.num7 .divBottom,.num7 .divLeft,.num7 .divLeftbottom,.num7 .divRightLeft").remove() }); }) } })(jQuery);