Hi, I wonder if anyone can help with a jQuery problem I am having.
I am using the tooltips from the Jquery Tools library to create a popup window when mousing over an hrefed image, this I want to use to cusomise the call to change the content in the DIV.
The links I am using are in the form:
<a href="/venue/1313.htm" class="quickView"><img src="/images/site/quickView83.png" alt="Quick View" width="83" height="20" /></a>
The code I am using to trigger the tip is:
$(".quickView").live('mouseover', function()
{
if (!$(this).data('init'))
{
$(this).data('init', true);
ajax_quickView();
$(this).tooltip
({
/* tooltip configuration goes here */
tip: "#quickViewWindow",
position: "right",
offset: [0, -300],
effect: 'slide'
});
$(this).trigger('mouseover');
}
});
I have tried the following function to grab the ID (in the example above, 1313) from the link:
function ajax_quickView(){
var pageNum = $("a.quickView").attr("href").match(/venue/([0-9]+)/).htm[1];
$("#quickViewWindow").load("/quick-view/", function(){})
}
However I think this is where it falls down, I think my regex is prob to blame...
Once I get the var pageNum I presume I can just pass it into the .load as:
$("#quickViewWindow").load("/quick-view/", {id : pageNum }, function(){})
Many thanks