I have the Jquery qtip() function and i need to get the id when mouseover a link. Can i'm using jquery .load() to get the page. Cant able to get using below code. Anyone know?
Below is my script
$(function () {
$(".cabinlink").qtip({
content: $("#loadCabin").load("/mysite ." + $(this).attr('id')),
show: 'mouseover',
hide: 'mouseout',
style: {
width: 780
},
position: {
corner: {
target: 'LeftBottom',
tooltip: 'TopLeft'
}
}
});
});
.cabinlink is the mousehover link
<a id="1" href="javascript:void(0)" class="cabinlink" />
<a id="2" href="javascript:void(0)" class="cabinlink" />
<a id="3" href="javascript:void(0)" class="cabinlink" />
loadCabin is the div to open up the qtip box
<div id="loadCabin"></div>
Amended codes, able to work but need to mouse over two times. first mouseover no result. Anyone know?
$(function () {
$(".cabinlink").live('mouseover', function () {
var id = $(this).attr('id');
var url = "/Mysite ." + id;
$(this).qtip({
overwrite: false,
content: $("#loadCabin").load(url),
show: { ready: true, when: false },
hide: 'mouseout',
style: {
width: 780
},
position: {
corner: {
target: 'LeftBottom',
tooltip: 'TopLeft'
}
}
});
});
});