我有一个名为Pixastic的jQuery插件的问题。我把它作为独立的库工作,但我不能用它与jQuery,因为它不起作用,我使用文档中的代码,仍然无法让它工作由于某种原因。
我遵循的文档:http://www.pixastic.com/lib/docs/#jquery
HTML(我不能把完整的HTML页面放在这里,因为它不会在这里显示?bug?,但只是因此你确定我将所有内容都包括在内)
<script src="jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="pixastic.full.js" type="text/javascript"></script>
<script src="f.js" type="text/javascript"></script>
<img id="image" src="014.jpg" />
JS(f.js)
$(document).ready(function()
{
/*
Pixastic.process(document.getElementById("image"), "blurfast",
{
amount : 3
});
*/
Pixastic.process(document.getElementById("image"), "desaturate"); // - Works
//$("#image").pixastic("desaturate"); // - Not so much...
});
答案 0 :(得分:1)
从您链接到的文档:
在链接动作时,在调用pixastic()方法之前确保图像完全加载尤为重要,因此将Pixastic代码放在onload事件或类似事件中可能是明智的。
您可能需要使用$(window).load()
而不是$(document).ready()
。 $("#image").load()
可能是一个更好的主意。