q提示2和图像
我正在使用qTip 2在hover时显示更大的图像,它半工作。 图像显示但不是全宽。 如何让它显示全宽?
码:
HTML
JS
var $j = jQuery.noConflict(); $j('.1').qtip({ content: '', position: { my: 'left top', at: 'right top', target: $j('.1') }, style: { classes: 'ui-tooltip-tipsy' } });
我该怎么做才能让图像显示全宽?
我尝试添加此代码,但它不起作用:
tip: { width: 600 }
您只需要更改css文件的max-width
:
.ui-tooltip, .qtip{ max-width: 900px; /* Change this? */ }
在jsfiddle看到这个例子
HTML:
JAVASCRIPT
$(function() { $("img").each(function() { $(this).qtip({ content: { text: function(api) { return ""; } } }); }); });
CSS
p { margin-top: 50px; margin-left: 100px; } img { padding: 10px; } .ui-tooltip, .qtip{ max-width: 10000px; /* Change this? */ }