나는 jeditable을 사용하고 있으며 jeditable에 바인딩 된 모든 중첩 요소가 있습니다. 문제는 중첩 된 요소를 클릭 할 때 클릭 이벤트가 최상위 부모에서 트리거되는 것입니다. 어떻게 이것을 피할 수 있습니까?jeditable propagation
$(document).ready(function() {
console.log('loading');
$('div.wrapper').editable('edit/', {
loadurl : 'edit/',
//id : 'section',
name : 'content',
submitdata : function(value, settings) {
var section = $(this).parent('section').attr("data-section");
return {
section: section,
type: 'ajax',
}
},
loaddata : function(value, settings) {
var section = $(this).parent('section').attr("data-section");
return {
section: section,
type: 'ajax',
}
},
rows : 6,
width : '100%',
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
indicator : 'Saving changes',
tooltip : "Doubleclick to edit...",
onblur : 'ignore',
event : "dblclick",
style : 'inherit',
callback : function(value, settings) {
// console.log(this);
console.log(value);
console.log(settings);
$('section[class^="annotation"]').each(function(index) {
$(this).attr('data-section', index + 1);
});
}
});
});
[편집]
가 여기에 HTML 코드입니다 :
<article>
<section class="annotation1" data-section="1" id="section_data-section1" typeof="aa:section">
<div class="wrapper" title="Doubleclick to edit...">
<h1>Section </h1>
<p>some content</p>
<section class="annotation2" data-section="2" id="subsection_data-section2" typeof="aa:section">
<div class="wrapper" title="Doubleclick to edit...">
<h2>Subsection </h2>
<p>some more content</p>
</div>
</section>
</div>
</section>
</article>
감사합니다! 당신이 이벤트 전파를 중지 할 수 있도록
HTML 코드를 제공 할 수 있습니까? –
당신도 HTML 코드를 제공 할 수 있습니까? –
나는 내 게시물을 편집했습니다 – Alex