<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jquery 内边框设置</title>
<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
img{max-width:100%; width:auto\9; height:auto; vertical-align:middle; border:0; -ms-interpolation-mode:bicubic;}
body{ font-family:"Microsoft yahei",arial; font-size: 14px; text-align: center;}
.wrapper{width: 1000px; margin:50px auto; text-align:left;}
ul{ margin:0; padding:0; list-style: none;}
.clearfix:before,.clearfix:after{ display:table; content:'';}
.clearfix:after{overflow: hidden; clear: both;}
.clearfix{zoom:1;}
.clear{clear: both;}
.imgBox li{ width:160px; float: left; margin:0 15px 15px 0; padding:5px;}
.imgBox li .img a{ display: block;}
.imgBox li .img img {width: 160px; height: 160px;}
.imgBox li .name{height: 30px; line-height: 30px; text-align: center;}
.imgBox li .name a{color: #333; text-decoration: none;}
.imgBox li .name a:hover{color:green; text-decoration: none;}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script type="text/javascript">
// 插件
;(function($) {
// 定义名称
$.fn.borderAnimate = function(options){
// 设置默认参数
var defaults = {
animated: 'easeOutElastic', // 动画名称
speed: 1500, // 延迟时间
borderClass: 'imgBd', // 边框的样式
borderWidth: 5, // 边框的宽度与长度
borderStyle: 'dashed', //边框的形式
borderColor: 'orange', // 边框的颜色
zIndex:1
};
// 可自定义参数设置
var options = $.extend({},defaults,options);
return this.each(function(i){
var _this = $(this);
// 判断边框html时候存在