我正在使用 qtip1.0。我需要在函数调用中显示 qtip。
如果我使用 content prerender: true,它会给出下面提到的错误。
JavaScript 运行时错误:无法获取未定义或空引用的属性“nodeName”
我已经在我的母版页中添加了这个。
<script src="Scripts/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script>
我的页面文档就绪功能中有以下代码。
$('#printDiv').qtip(
{
show: {
event: 'click', // Show it on click
solo: true // And hide all other tooltips
},
content: {
prerender: true,
title: {
text: 'Core Details',
button: 'Close'
},
text: 'Show the content'
},
position: {
target: $(this).closest($(document.body)), // Position it via the document body...
corner: 'center' // ...at the center of the viewport
},
style: {
width: { max: 650 },
padding: '14px',
border: {
width: 9,
radius: 9,
color: '#666666'
},
name: 'light'
},
api: {
beforeShow: function () {
// Fade in the modal "blanket" using the defined show speed
$('#qtip-blanket').fadeIn(this.options.show.effect.length);
},
beforeHide: function () {
// Fade out the modal "blanket" using the defined hide speed
$('#qtip-blanket').fadeOut(this.options.hide.effect.length);
}
}
});
// Create the modal backdrop on document load so all modal tooltips can use it
$('<div id="qtip-blanket">')
.css({
position: 'absolute',
top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled
left: 0,
height: $(document).height(), // Span the full document height...
width: '100%', // ...and full width
opacity: 0.7, // Make it slightly transparent
backgroundColor: 'black',
zIndex: 5000 // Make sure the zIndex is below 6000 to keep it below tooltips!
})
.appendTo(document.body) // Append to the document body
.hide(); // Hide it initially