简体   繁体   中英

Jquery Tooltip image height & width

I have this tooltip code which works as a charm but I would like to know how do I set max height & width. Here is my code snippet:

<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>
}

Have you tried adding the style inline as you create the element? Something like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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