[ Tips ] My Meteor works and I don't know why
I was trying to let the Summernote plugin work after clicking a button.
The class was hiding inside a {{#if}} expression and I was hoping the div can work after the click action.
I finally find out using the setTimeout will make this work!
setTimeout(function(){
$('.editor').summernote({
height: 286,
toolbar: [
['style', ['style']],
['style', ['bold', 'italic', 'underline', 'clear']],
['fontsize', ['fontsize']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['color', ['color']],
['insert', [ 'link', 'picture', 'video']],
['table', ['table']],
['view', ['codeview']],
['help', ['help']]
]
});
},0);
Can anyone tell me why this works?
and why .ready doesn't?
Written by Andy Tseng
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#