我试图在tinymce编辑器中隐藏我的textarea值,但它不起作用。 所以如何使用jquery。
Html代码:
<div class="top_attach_sub tiny_but" align="center">
<textarea id="flow_button_view" name="dessc_desk" class="social_text_area tiny_but_text" placeholder="What's on your mind?">
<span id="title_txt_bar">
What's on your mind?
</span>
</textarea>
</div>
Jquery:
<script type="text/javascript">
var $title_bar = $("#title_txt_bar");
tinymce.init({
selector: "textarea",
menubar:false,
statusbar: false,
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor table code"
],
content_css: "css/content.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link | preview fullpage | forecolor backcolor emoticons | inserttable | code ",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
init_instance_callback: function (editor) {
editor.on('focus', function (e) {
$title_bar.hide();
});
}
});
所以当我点击textarea tinymce框而不是我需要的值隐藏时。
感谢所有