这个地方怎么实现的?
图中的小喇叭,鼠标点击即显示,但是网页源码里面看不到“onclick=”这样的字眼。请问加上“onclick=”的脚本在哪里?
分享到: 更多
------解决方案--------------------
截取部分代码,应该是绑定了class的点击事件
http://csdnimg.cn/rabbit/notev2/js/notify.js
self.on('panel_showed', function (e, showdetail) {
var hasget = false, unreadsdata;
self.resetposition();
// 显示面板内容
if (unreads !== 0) {
self.getunreads(self.showlistcbwrap(function (err, data, loading) {
unreads = 0;
unreadsdata = data.data;
}));
hasget = true;
}
if (!hasreadeditems) {
$('.notice_content', self.dom.wrap).empty();
self.getallreaded(self.showlistcbwrap(function (err, data, loading) {
hasreadeditems = true;
}));
hasget = true;
}
if (hasget) {
self.dom.wrap.one('list_showed', function (e, err) {
if (err) {
self.error(err);
} else {
if(showdetail) {
var unreadsitem = $('.notice_list_con .unread', self.dom.wrap);
if(unreadsitem.length === 1) {
unreadsitem.trigger('click');
}
}
if (unreadsdata && unreadsdata.length > 0) {
keepunread = true;
settimeout(function() {
self.setreaded(unreadsdata);
}, 1000);
}
}
});
}
}).on('detail_showed', function (e, detail, index) {
// 显示通知详情
$('.detail_con .prvnote', self.dom.wrap).toggleclass('disabled', !(index > 0));
$('.detail_con .nextnote', self.dom.wrap).toggleclass('disabled', !detail.next()[0]);
if (!detail.data('loaded') && !$('dd', detail)[0] && !$('.empty:visible', detail)[0] && !$('.loading:visible', detail)[0]) {
self.getdetail(detail);
}
}).on('tip_showing', function () {