jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了需要有关圆角的jquery插件的建议大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我想了解 jquery插件,所以我决定尝试制作一个简单的圆角盒.我知道那里已经有一些圆角插件,但这对我来说比工作要求更像是一种学习练习.

我从here拍摄的圆角.我喜欢这个样本,因为它不使用图像,很容易改变盒子的颜色.

我想我无法绕着最好的方式缠绕我的大脑.我有一个非常粗略的样本,它有点工作,但它感觉不对.让我兴奋的部分是在内容区域周围构建圆角.现在它需要“内容”框并附加它周围的角落.有什么更好的方法呢?

这是打电话的方式 – $(‘#content’).roundBox();

如果这还不够,请告诉我.

//
(function($)
{
jQuery.fn.roundBox = function(options)
{

    var opts = $.extend({},$.fn.roundBox.defaults,options);

    var outer = $("<div>");
    var topBorder = $("<b class='xtop'><b class='xb1'></b><b class='xb2'></b><b class='xb3'></b><b class='xb4'></b></b>");
    var bottomBorder = $("<b class='xbottom'><b class='xb4'></b><b class='xb3'></b><b class='xb2'></b><b class='xb1'></b></b>");
    var title = $("<h1>SELEct Funding</h1>");
    var separator = $("<div></div>");

    $(this).append(titlE);
    $(this).append(separator);

    var firstElement = $(this).children()[0];
    if (firstElement != null)
    {
        title.insertBefore(firstElement);
        separator.insertBefore(firstElement);
    }

    outer.append(topBorder);
    outer.append($(this));
    outer.append(bottomBorder);

    $("#fundingAdminContainer").append(outer);


    //Add classes
    outer.addClass(opts.outerClass); //outer container
    $(this).addClass(opts.contentClass); //inner content
    title.addClass(opts.titleClass); //roundBox title
    separator.addClass(opts.lineClass); //line below title
};

$.fn.roundBox.defaults =
{
    outerClass: 'roundBox',contentClass: 'roundBoxContent',titleClass: 'roundBoxtitle',lineClass: 'roundBoxLine'
};


})(jQuery);


//CSS
.roundBox
{
float:left;
width:400px;
margin-right:20px;
}

.roundBoxContent
{
display:block;
BACkground:#ffffff;
border:0 solid #D4E2FE;
border-width:0 1px;
height:180px;
padding:10px;
}

.roundBoxLine
{
BACkground: url(../images/fundingAdmin_line.gif);
BACkground-repeat:no-repeat;
height:5px;
}

.roundBoxtitle
{
font-size:1.3em; color:#17A2D3;
}

.xtop,.xbottom {display:block; BACkground:transparent; font-size:1px;}
.xb1,.xb2,.xb3,.xb4 {display:block; overflow:hidden;}
.xb1,.xb3 {height:1px;}
.xb2,.xb4 {BACkground:#ffffff; border-left:1px solid #D4E2FE; border-right:1px solid #D4E2FE;}
.xb1 {margin:0 5px; BACkground:#D4E2FE;}
.xb2 {margin:0 3px; border-width:0 2px;}
.xb3 {margin:0 2px;}
.xb4 {height:2px; margin:0 1px;}

盒子的最终结构应该是:

<div id="fundingAdminContainer"><!-- Not part of rounded Box,just serves as a container. -->
    <div class="roundBox">
        <b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
        <div id="content" class="roundBoxContent">
            <h1 class="roundBoxtitle">title</h1>
            <div class="roundBoxLine"></div>
                //CONTENT
        </div>
        <b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b></b>
    </div>
</div>

解决方法

http://www.curvycorners.net/ http://www.curvycorners.net/

javascript库,不是jQuery插件,但它似乎工作:D

大佬总结

以上是大佬教程为你收集整理的需要有关圆角的jquery插件的建议全部内容,希望文章能够帮你解决需要有关圆角的jquery插件的建议所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。