1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| let onClick = function (dom, obj) { if (dom.avtive) { dom.avtive = false; hide(); } else { dom.avtive = true; show(dom, obj) } } let appendDomEvent = function (dom, obj) { if (obj.event == 'click') { dom.addEventListener('click', function () { return onClick(dom, obj); }, false) } if (obj.event == 'mouseouver') { dom.addEventListener('mouseover', function () { return onMouseOver(dom, obj); }, false) dom.addEventListener('mouseout', function () { return onMouseOut(dom, obj); }, false) } }
|