REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    HTML dropdown menu color animation

    REXYGEN HMI Designer
    3
    3
    291
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Apollo
      last edited by

      I added a HTML horizontal dropdown menu on the top of the page to navigate to all different process pages.
      Would it be possible to do some color animation of the text in this menu if an alarm is active on some page?
      Like this it is possible to draw the attention of the operator directly to the correct page.

      Can someone give me a hint how to do this, if possible? (the menu is using made of only HTML and CSS.)

      Thx & grtz,

      Kris

      1 Reply Last reply Reply Quote 0
      • ondrej_severaO
        ondrej_severa
        last edited by

        Hello Kris,
        you have to subscribe for reading the alarms (some boolean signals I guess) on the main page or on every page. This depends on your project structure.
        I don't know what kind of HMI you are using (WebBuDi, HMI Designer, or custom) but basically, you have to add

        <script>
        REX.HMI.init = function(){
          REX.HMI.addItem({alias:"ALARMS", cstring:"task.alarm_block_or_subsytem:parameter"}).on('change',function(itm){
            let index = itm.getValue();
            /* HERE you have to pick the <li> or  other element of you menu*/
            let elem = // Some jQuery or document.queryselector magic
            elem.style.backgroundColor = 'red';
          })
        }
        </script>
        

        If you are using HMI Designer, you can follow the example 0301-10_Custom_HMI_Component

        or you can read Chapter 5 of the HMI manual
        BR
        Ondrej

        1 Reply Last reply Reply Quote 0
        • S
          Scoobsalamander
          last edited by

          Thank you for this solution, unfortunately I don't have the time to try this out at the moment.
          It will have to wait until the second part of next week. I'm already happy that there is a possibility to make it work.

          Kris

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

          There is also an outdated REXYGEN community forum.

          Powered by NodeBB.