I have a jQuery menu which expands upon mouseover. All sub-menu items can be clicked on and some sub-menu items have further sub-items when hovered over.
I want to temporarily disable the click event of one of the mid-level menu items so that clicking on it will not fire its click event but will open the next sub-level (I have tried simulating hover over with the Selenium Actions class but it doesn't work).
I have the following code:
((IJavaScriptExecutor)driver).ExecuteScript("$('a:contains(Parent Menu Item)').click();");
((IJavaScriptExecutor)driver).ExecuteScript("$('a:contains(Child Menu Item)').off('click');");
The first line works: the menu expands and the child element is visible. The second line has no effect.
How can I get the jQuery to run in the order it appears in my code?
Related
Most of the side menus in javascript, which are in a tree format or what are called as accordion menu, when the parent node is clicked, a panel opens. The node click acts like a toggle. What I want is a menu like dtree, where a plus icon can be used as toggle and the actual node text can have a URL.
Does anyone know of such a menu or is it possible to create one?
Thanks in advance.
I tried the bootstrap menus, but I cannot use a URL on the toggle menu node
I'm not able to get routerLink activated on the dropdown on init.
It works after I trigger the dropdown by clicking on it once and keeps working even after I close it.
It isn't working on init because the dropdown DOM is not rendered by that point.
It gets rendered after the dropdown button is clicked.
I want the dropdown list rendered and hidden on init please.
StackBlitz that reproduces the issue:
https://stackblitz.com/edit/ngx-bootstrap-dropdown
This is the default stackblitz for ngx-bootstrap-dropdown.
If DOM is observed, on init, the dropdown elements are not rendered but after it is opened and closed, the elements are there.
On init before the button is clicked
After the dropdown is clicked and closed, the ul is there
What I am looking for is a proper way to use the dropdown pre-rendered (and definitely hidden) so that routerLink is already working
My point is want the tab menu item auto open when it highlighted and if any element within the tab is highlighted the next step will focus on the element.
Anyway, I'm using JSON to provide steps I only know that this may use intro.onbeforechange(function(targetElement) { but I don't know how to write the condition to make it work
At http://brianreavis.github.io/selectize.js/ -- if you scroll down to Single Item Select and click on the dropdown -- is there a way to keep the dropdown open without it closing as soon as you click elsewhere?
I've tried unhiding divs and forcing element states to no avail.
I have a panel with a docked toolbar and an icon inside it. The panel has several items (accordion layout). I want to enable the icon only for selected items. I.e. when a valid item is active the button should be become enabled, and then be disabled if the user activates an item that the icon is not applicable for.
I tried disabled: function() { some code to find whether item is valid .. }, but that didnot work.
I also researched panel listeners to find one for item change and then use button.setDisabled(bool) but couldnot find the right event to use.
How do I achieve this?
p.s. I am using ExtJS 4.1.
When you change items in an accordion, they panel that gets activated will fire the expand event. So listen to the expand event on each panel, then call enable/disable on the appropriate buttons.