Link to home
Start Free TrialLog in
Avatar of jnr123
jnr123

asked on

Expand Current Bookmark Javascript

I want to create a form button that, when clicked, will expand a bookmark. Or, I want a bookmark to expand when navigating to a certain page.

I found this javascript somewhere else but it won't work.

tocbm = this.bookmarkRoot.children[0];
tocbm.execute;

Does anyone know if this is possible, thanks.
Avatar of musalmik
musalmik

Well, your question is old, but I'm new to EE so I could not answer earlier.

The execute method can only be used to call a defined action. Because there is no action like opening a bookmark subtree, that method cannot be used for this purpose.

You can instead use the open attribute of bookmarkroot children objects:

this.bookmarkRoot.children[0].open = 1;

would open the subtree while ...open = 0 would close it.

Have fun
Maik
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial