在div内弯曲文本

时间:2016-05-19 21:23:59

标签: javascript jquery css css3



 $().ready(function() {
$('#demo1').circleType({fitText:true, radius: 180});   });
  $().ready(function() {
            $('#example').arctext({radius: 250});
        });

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://tympanus.net/Development/Arctext/js/jquery.arctext.js"></script>
&#13;
<div id="example">Here is curved text dmsdodsfnfsadknsdf></div>
<br>

<div id="demo1"> Here’s some curved text flowing clockwise.</div>
&#13;
&#13;
&#13;

你好,我想知道是否可以使用像enter image description here这样的按钮在div内曲线文本

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:3)

您的代码显示您正在尝试使用2个不同的库:ArcText(http://tympanus.net/Development/Arctext/)和CircleType(http://circletype.labwire.ca/)。您需要引用jQuery,ArcText和Circletype库。

您应该下载ArcText和Circletype以在本地引用,如下所示:

<script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
<script src="/js/circletype.js"></script>
<script src="/js/jquery.arctext.js"></script>

然后你的JavaScript运行良好:

$(function(){
  $('#demo1').circleType( {fitText:true, radius: 180} );
  $('#example').arctext( {radius: 250} );
});

JSFiddle演示:https://jsfiddle.net/stevenng/nyawqaab/