我正在尝试安装弹性插件。这是我第一次安装任何插件。我从网站上传了两个文件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>
它不起作用。我做错了吗?
答案 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>