Вызов API CKAN для возврата метаданных для всех ресурсов resource_views на веб-сайте CKAN

взгляните на мой код, он делает font size smaller на fit там, где есть

, но я думаю, что это не привело к хорошему опыту пользователя

var containerWidth = $("#ui-id-2").width();
var items = $(".quickSearchAutocomplete .ui-menu-item");
var fontSize = 16;

items.each(function(){
    //display value depend sometimes on your case you may make it block or inline-table instead of inline-block or whatever value that make the div take overflow width
    $(this).css({"whiteSpace":"nowrap","display":"inline-block"});
    while ($(this).width() > containerWidth){
         console.log("$(this).width()"+ $(this).width() + "containerWidth" + containerWidth)
         $(this).css("font-size", fontSize -= 0.5);
    }
});

надеюсь, что это поможет вам

1
задан Mark 30 March 2019 в 23:50
поделиться

0 ответов

Другие вопросы по тегам:

Похожие вопросы: