| Page 1 of 1 | [ 3 posts ] |
|
YAHOO.widget.Menu do not scroll to selected item
I need to scroll down to the selected item of my popup menu I am highlighting in the scroll menu I developed, everything else works fine but following code does not work. oMenu.show(); //oMenu.getItem(idx).cfg.focus(); oMenu.getItem(idx).cfg.setProperty("selected", true); Please suggest on this as soon as possible. |
|
Hi ankur_b,
Seems like you posted this several times on different parts of the forum. It looks like you are trying to use YUI 2 so if you had posted this in "YUI 2 - Components" you would have probably gotten a better response - for the future. I took the YUI 2 example http://developer.yahoo.com/yui/examples/menu/example11.html and modified it as below; Code: // Create the menu ... "basicmenu" is an ID for HTML markup container var oMenu = new YAHOO.widget.Menu("basicmenu", { fixedcenter: true } ); // Populate it ... oMenu.addItems([ { text: "Selected MenuItem", selected: true }, { text: "Disabled MenuItem", disabled: true }, { text: "MenuItem With A URL", url: "http://www.yahoo.com" }, { text: "Checked MenuItem", checked: false } ]); // Render and show it .... oMenu.render(); oMenu.show(); // Setup a timer, after 3 seconds, // unselect first item and select/check fourth item ... YAHOO.lang.later( 3000, this, function(){ oMenu.getItem(0).cfg.setProperty('selected',false); oMenu.getItem(3).cfg.setProperty('selected',true); oMenu.getItem(3).cfg.setProperty('checked',true); }); This works for me. Good luck, Todd |
|
As suggested , updated issue in YUI2.x forum.
description is there and this solution is not working for my case. |
| Page 1 of 1 | [ 3 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