Answer the question
In order to leave comments, you need to log in
How to make elements show and hide smoothly?
I use backbone.js for my project.
It makes sense for the user class to hide some elements.
For example, the toolbar.
It turns out that I render the entire template. Then I hide a certain element with $('.class').hide or display: block. And it's noticeable. It can be seen how when you go to the page, the element is there and then hidden, all this is very clumsy.
How can this be done without the user noticing?
Answer the question
In order to leave comments, you need to log in
pass the user model to the template and, by condition, do not draw the panel if the user is not an admin
As an option, initially make the unnecessary hidden and only then show it.
In a good way - to give different templates on the server. Or you change the render yourself. Conditions are implemented in many template engines.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question