繁体   English   中英

jQuery工具提示图像的高度和宽度

[英]Jquery Tooltip image height & width

我有此工具提示代码,它很吸引人,但我想知道如何设置最大高度和宽度。 这是我的代码段:

<script type="text/javascript">
    $(document).ready(function () {        
        $('.hoverElement').each(function () {
            var id = $(this).attr('id');
            $(this).tooltip({ content: '<img src="@Url.Action("ShowImage")' + '?email=' + id + '" />' });
        });
    });
</script>

foreach (var item in Model.People)
{
<a class="hoverElement" href="#" title="" id="@item.Email" >@item.Name()</a>
}

在创建元素时,您是否尝试过内联添加样式? 像这样:

content: '<img style="max-height:100px;" src="@Url.Action("ShowImage")' + '?email=' + id + '" />'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM