用jQuery选择器初始化Raphael对象

在拉斐尔的文件中,我们用拉斐尔
var paper = Raphael(document.getElementById("notepad"),320,200);

我想用jQuery选择我的课程,把它转到Raphael,所以我的想法是:

var paper = Raphael($(".myClass"),200);

但是我得到TypeError:b在Raphael.js中未定义.有谁知道如何做到这一点?

解决方法

尝试:
var paper = Raphael($(".myClass")[0],200);

$函数返回一个数组类型的HTML元素对象,所以使用[0]获得第一个.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...