이 유성 클라이언트 코드는 버튼이 클릭되었다는 인상을 주려고합니다. 이벤트를 사용하여 div
에 클래스를 적용하지만 브라우저 요소 탭을 확인할 때 클래스를 적용하지 않습니다.
무엇이 문제입니까? 감사합니다버튼 클릭 인상 시뮬레이션
Template.footer.events({
'click .footerItem': function(event) {
//do some stuff here
},
'onmousedown .footerItem': function(event) {
$(event.target).addClass('inset');
},
'onmouseup .footerItem': function(event) {
$(event.target).removeClass('inset');
}
});
.inset {
box-shadow: inset 2px 2px 6px #999;
}
.footer-row {
text-align: justify;
background-color: white;
}
<template name="footer">
<footer class="footer-row">
{{#each footerButtons}}
<div class="footerItem" data-action={{this.action}}>{{this.label}</div>
{{/each}}
</footer>
</template>