ねえ、私はこのコードを持っています:
$('#album_cell' + currentCell).toggle(
function() {
$('#album_cell'+currentCell).flip({
direction: 'lr',
color: "#FFF",
content: '<?php echo form_open('subjects/insert_caption');?>'
+ '<textarea id="caption_input' + currentCell + '">'
+ ' <?php echo $this->lang->line('insert_catpion_text'); ?>'
+ '</textarea>'
+ '<input type="submit" id="submit_caption' + currentCell + '" value="<?php echo $this->lang->line('save'); ?>" /> '
+ '<?php echo form_close(); ?>'
+ ''
});
},
function() {
$('#album_cell'+currentCell).revertFlip();
}
);
私はCodeIgniterとjQueryFlipプラグインを使用しています。これは無関係ですが、未知のコードを説明している人もいます。
これですべてのデータが正しくなり、プラグインは最初のクリック後にコンテンツを作成し、期待どおりに元のデータに戻ります。
今私の質問は、作成されたコンテンツにイベントをバインドして、内側のテキストエリア/ボタンをクリックしてもtoggle
メソッドが起動しないようにするにはどうすればよいですか?
編集:
要求に応じて、これは出力されたHTMLです。
<form action="http://localhost/ci/index.php/subjects/insert_caption" method="post" accept-charset="utf-8">
<textarea id="caption_input1">add</textarea>
<input type="submit" id="submit_caption1" value="save">
</form>
私はもう試した :
$('#album_cell'+currentCell).on(
'click','#caption_input'+currentCell,function() {
alert();
e.stopPropagation();
});
しかし、それは機能しませんでした。イベントを発生させますが、それでも切り替わります。