Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Is there a way to have can.view call a callback function when an EJS template is actually rendered and visible on screen?

$
0
0
Hello All,

I've been trying to find a way to this for a while now. I know that it is possible to have callbacks for can.view when an EJS template has been "processed" but I'm trying to find a way to know when a template is actually finished rendering on screen and visible.

I tried using various callbacks provided by can.view and can.view.render but all the callbacks run before the templates have been rendered on screen.

I also tried the can.view.hookup since it sounded exactly like what I needed but it was still triggering the callback before the template is visible on screen. Although I'm not entirely sure that I used it correctly.

I'm all out of idea now and was thinking of maybe using the PageVisibility API from HTML5 but I'd rather not do that because of backwards compatibility issues.

Any help would be greatly appreciated!

Thanks,
Colin Zhu

Viewing all articles
Browse latest Browse all 3491

Trending Articles