弹性插件无法正常工作

时间:2011-07-26 00:22:08

标签: jquery elasticlayout

我正在尝试安装弹性插件。这是我第一次安装任何插件。我从网站上传了两个文件jquery.elastic.source.js和jquery.js。这是我的代码:

<script type="text/javascript" src="js/jquery.elastic.source.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="http://google-cdn.joinpgn.com/js/jquery/jquery-1.5.2.min.js"></script> 


<textarea id="description">
This textarea is going to grow when you fill it with text. Just type a few more words in it and you will see.
</textarea>

<script>
jQuery('#description').elastic();

</script>

<style>
body { background: #0D1114; }
.project-name a { padding: 0; color: #3cf; text-transform: uppercase; font: bold 13px/30px 'Arial', 'sans-serif'; }

textarea { padding: 10px; width: 300px; font-family: Arial, 'sans-serif' }
</style>

它不起作用。我做错了吗?

1 个答案:

答案 0 :(得分:0)

在包含jquery.elastic.source.js后,您需要添加jquery.js

您的脚本标记应如下所示:

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.elastic.source.js"></script>

<script type="text/javascript" src="js/jquery.elastic.source.js"></script>
<script src="http://google-cdn.joinpgn.com/js/jquery/jquery-1.5.2.min.js"></script>