Answer the question
In order to leave comments, you need to log in
How to call a function after rendering the entire template (including internal templates) or change the added tag with Javascript?
How to track when the rendering of the page has ended if the following construction is used:
<template name="creator">
{{#each banners}}
{{> banner}}
{{/each}}
</template>
<template name="banner">
<textarea cols="33" rows="1" id="text1" style = "resize: none">{{group}}</textarea>
</template>
$(textarea).height(textarea.scrollHeight);
Answer the question
In order to leave comments, you need to log in
You can use the hack with Meteor.defer
. The function passed to it will be executed after the DOM is rendered:
Template.creator.onRendered(function(){
Meteor.defer(function(){
//Код
});
});
Template.creator.onRendered(function(){
Meteor.defer(function(){
$('textarea').each(function(){
$(this).height(this.scrollHeight);
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question