jQuery UI Widgets Forums Lists DropDownList Indicator when drop-down has focus?

This topic contains 2 replies, has 2 voices, and was last updated by  jcwren 9 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • jcwren
    Participant

    I have a pop-up window with text boxes and drop-down lists. When I hover the mouse over a drop-down, it turns darker (using the Dark Blue theme), and even darker when it’s opened. However, when tabbing through the drop-down lists, although it has focus (responds to down arrow, etc), it doesn’t change to the darker color as it does when the mouse is hovering over it.

    Is there a way to cause the control to indicate it has focus, using the ‘hover’ or ‘opened’ section of the current theme?


    ivailo
    Participant

    Hi jcwren,

    You can use on(“focus”)/on(“focusout”) to change the indication via CSS.
    See at this fiddle.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    jcwren
    Participant

    Perfect. And with the wonderfulness of jQuery, and some selective field naming, that boils down nicely to this:

    $("[id^='ec-']").on ('focus', function () {
      $(this).addClass ('jqx-menu-item-top-hover-' + theme);
    });
    $("[id^='ec-']").on ('focusout', function () {
      $(this).removeClass ('jqx-menu-item-top-hover-' + theme);
    });
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.