【问题标题】:elastic plugin not working弹性插件不起作用
【发布时间】:2011-10-13 00:43:29
【问题描述】:

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

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

【问题讨论】:

  • 什么是js/jquery.js?如果这只是 jQuery 源代码,那么为什么还有 jquery-1.5.2.min.js 源代码?你只需要一个或另一个。 .min.js 版本被压缩,但与非最小源代码相同。最后,你的弹性源应该在你加载 jQuery 源之后出现。
  • @Hristo 如果你能帮我做一件事?它在右侧添加了一个滚动条,这是为什么?我可以删除它吗?
  • 我想通了。如果其他人在这里寻找相同的东西是代码:
  • @Gurnor... 可能有几个原因。你能在 jsFiddle.net 上提供一个小的工作示例吗?点击左侧的“添加资源”即可添加弹性源。

标签: jquery elasticlayout


【解决方案1】:

您需要在包含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>

【讨论】:

    猜你喜欢
    • 2011-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多