<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Jquery Custom Plugin</title>
http://code.jquery.com/jquery-1.10.1.min.js
(function ($){
$.fn.Tabs = function (options){
var settings = $.extend({
color : “#000000”,
background : “#ffffff”,
container : ”,
dafault : 1
}, options );
this.css({
‘color’: settings.color,
‘background-color’: settings.background
});
$(“#”+settings.container).ResetAll();
$(‘#c’+settings.dafault).show();
$(‘#’+settings.dafault).css( “color”, “red” );
$(this).children(“a”).on(‘click’, function() {
$(“#”+settings.container).ResetAll();
$(‘#c’+$(this).attr(“id”)).fadeIn(“slow”);
$(this).css( “color”, “red” );
});
};
$.fn.ResetAll = function() {
$(this).children(“div”).hide();
this.find( “a” ).css( “color”, “black” );
};
}(jQuery));
$( document ).ready(function() {
$( “#test” ).Tabs({
color: “#000000”,
background: ‘#cccccc’,
container: ‘test’,
dafault : 1
});
});
<style>
.cont{
width:400px;
padding:10px;
border:1px solid #000000;
}
.cont a{
text-decoration: none;
background-color:#FFFFFF;
border:2px solid #000000;
padding:2px;
}
</style>
</head>
<body>
Tab 2
Tab 3
background-color: #E4F5F8;
border: 1px solid #C0DEED;
text-decoration: none !important;
}
</div>
</body>
</html>