This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Font Text
#1
I have a group dress which can have a value between 12 and 71. Let call it groupadress A. On my visualization, I have an object (other group adress), groupadress B.

Can I change the font of B on the visualization, based on the value of A?
Reply
#2
Something like this should do the trick, give your button a custom class (mycustomclass in this sample)

Code:
$(function(){
  if (typeof grp != 'undefined') {
    grp.listen('1/5/1', function(object, state) {
      if (state == 'value') {
        if (object.value == true) {
          $(".mycustomclass .value").css({"font-family":"Arial, Helvetic, Sans-Serif", "font-size":"300%", "color":"#c0ba2c"});
        } else {
          $(".mycustomclass .value").css({"font-family":"Fantasy", "font-size":"200%", "color":"#c35e1e"});
        }
      }
    }, true);
  }
});
Reply
#3
Here's a working example:
Code:
$(function() {
  if (window.grp) {  
    grp.listen('32/1/2', function(object, state) {
      var size = Math.max(12, object.value);
      $('.size').css('font-size', size + 'px');
    });
  }
});

32/1/2 is the groups address that sets the size. size is the Additional class of the element where font size should be changed dynamically.
Reply
#4
Thans you very much.

Every time, I am amazed by what is possible with LM. Such a small device with so many possibilities!
Reply


Forum Jump: