弹性插件不工作



我正在尝试安装弹性插件。这是我第一次安装任何插件。我从网站上上传了两个文件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>

它不工作。我做错什么了吗?

您需要在包含jquery.js之后再包含jquery.elastic.source.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>

最新更新