| Page 1 of 1 | [ 4 posts ] |
|
Hi all,
when the page loads am gonna make particular div blinking. at the same time i want to set focus on that div. YUI().use("node","anim", function(Y) { var node=Y.one("#id"); node.focus(); var anim = new Y.Anim({ node: node, from: { backgroundColor:"#FFFFFF" }, to: { backgroundColor:"#333333" }, duration:0.5, iterations: "infinite", direction: "alternate" }); anim.run(); node.focus() }); node.focus() not working.. please help me on the same. |
Alberto SantiniYUI Contributor
|
Hello Divya.
I think you need to use tabindex attribute because it is not an input element, so the concept of focus is quite weak. If I understood correctly the question this is a working example: http://jsfiddle.net/qZaJK/1/ Press tab and you see the focus changing (with Chrome you see a yellow border). Another way to interpret your question is about scrolling: scrolling until that div is displayed. In this case scrollIntoView may help you. Hope that helps, IceBox P.S.: Next time it would be better to play with a jsfiddle snippet and I think animation is not relevant. |
|
thank you Alberto
|
|
Thank you
|
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group