我想创建段落可编辑的onclick。我做了段落可编辑,但只有一个问题是,当我点击文本区域的外侧它成为正确的段落但我第二次点击段落它不起作用。 我真的很抱歉我的英语。 非常感谢你的帮助。
HTML:
<p id="about">This is paragraph</p>
SCRIPT:
$(document).ready(function() {
function paraClicked() {
var aboutText = $('#about').html();
var editableText = $('<textarea />').css({'width': '100%', 'font-size': '20px'});
editableText.val(aboutText);
$('#about').replaceWith(editableText);
editableText.focus();
editableText.blur(editableTextBlured);
}
function editableTextBlured() {
var text = $(this).val();
viewavleText = $('<p>');
viewavleText.html(text);
$(this).replaceWith(viewavleText);
$(viewavleText).click(paraClicked);
}
$('#about').click(paraClicked);
});
答案 0 :(得分:4)
答案 1 :(得分:4)
在将其更改为pragraph之后,您没有指定ID。 改变这一行
// in any specific method or event handler write
// the below code while initializing the Front camera
private AudioVideoCaptureDevice videoCapture = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Front, new Windows.Foundation.Size(640, 480));
videoCapture.SetProperty(KnownCameraGeneralProperties.EncodeWithOrientation, -90);
rt.Angle = -90;
videoBrush.SetSource(videoCapture);
到此
viewavleText = $('<p>');