js特效 在服务器显示变形,使一行文字变形产生弯曲弧度特效的jQuery插件 - Arctext.js...

CSS3可以帮助我们旋转字体,但是如果想让一行字体产生弧度曲线的效果,稍微有点儿费劲。今天分享一个jQuery插件:Arctext.js ,可以有效的帮助我们生成一行带有弧度的文字效果。它能够自动计算正确的旋转角度,并且生成对应的CSS3。希望大家喜欢!

插件选项

radius:0

最小的值是文字长度,如果设置为-1,则显示直线。

dir:1

1:向下弯曲

2:向上弯曲

rotate:true

如果为true,则每个字母都旋转。

fitText:false

如果你想尝试使用fitText插件,设置为true,记住包装的标签需要fluid布局。

Javascript代码

function init() {

$headline.show().arctext({radius: 400});

$word1.show().arctext({radius: 148});

$word2.show().arctext({dir: -1});

$example1.show().arctext({radius: 300});

$example2.show().arctext({radius: 400, dir: -1});

$example3.show().arctext({radius: 500, rotate: false});

$example4.show().arctext({radius: 300});

$('#button_set').on('click', function() {

$example4.arctext('set', {

radius  : 140,

dir   : -1

});

return false;

});

$('#button_anim1').on('click', function() {

$example4.arctext('set', {

radius  : 300,

dir   : -1,

animation : {

speed : 300,

easing  : 'ease-out'

}

});

return false;

});

$('#button_anim2').on('click', function() {

$example4.arctext('set', {

radius  : 200,

dir   : 1,

animation : {

speed : 300

}

});

return false;

});

$('#button_reset').on('click', function() {

$example4.arctext('set', {

radius  : 300,

dir   : 1

});

return false;

});

};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值