jq如何动态获取标签id方法?
mzoy 2014-04-09 03:37:53 { field: 'CoorPhoto', title: '图片', width: $(this).width() * 0.1,
formatter: function (value, rec, index) {
var s = '<ul id="second"> <a id="photo" href="<%=ImageUrl%> '+ rec.CoorPhoto + ' " style="hand: cursor; text-decoration: none;">' + rec.CoorPhoto + '</a></ul>';
return s;
}
},
这是datagrid里的一个字段,我想实现通过imgPreview 插件实现图片的预览,
$('ul#second a').imgPreview({
imgCSS: { width: 200 }
});
怎样才能获取到a标签中的id值来调用上述方法呢