Logic Machine Forum
Object Value - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Object Value (/showthread.php?tid=4810)



Object Value - sjfp - 06.06.2023

Have a simple transparent square icon with a solid blue boarder, but rather than the object value being underneath icon, I want to place it inside the icon central to both horizontal and vertically positions.


RE: Object Value - admin - 06.06.2023

Use value-center Additional class. Add to Custom JS:
Code:
$(function() {
  $('.value-center').each(function(_, el) {
    var valueel = $('.value', el);
    var iconheight = $('.icon', el).height();
    var valueheight = valueel.height();
    var offset = (iconheight + valueheight) / 2;

    valueel.css('margin-top', -offset + 'px').css('padding-top', 0);
  });
});



RE: Object Value - sjfp - 08.06.2023

Thank you worked out great