Hi
I found this nice code for changing the font size of text element responsivly
and it’s working great. the point is that I’m trying to use it for my menu element (because on small desktop screens it does not scale down (as it should in a responsive site), but I can’t find out how to reference the menu items text.
this code isn’t working for me. (but it is working on a normal text element)
Thank you.
$w.onReady( function () {
makeResponsive(“#menu1”,“h4”,5);
});
function makeResponsive(elementId,textTheme,fontSize,fontColor,lineHeight,charSpacing,width) {
let style = “font-size:”+fontSize+“vw;color:”+fontColor+“;line-height:”+lineHeight+“;letter-spacing:”+charSpacing+“vw;width:”+width+“vw”;
$w(elementId).html = “<”+textTheme+" style=“+style+”>“+$w(elementId).text+”</“+textTheme+”>";
}