I am using a combination of Drupal Views, ajax and the hoverIntent plug-in to display content. Problem is, after an ajax request the 'hoverIntent' event is no longer bound to the my selector (in this case each row of the view). Does anyone have a solution to this?
[Link to plug-in uncompressed hoverIntent js](http://cherne.net/brian/resources/jquery.hoverIntent.js)
[hoverIntent home page](http://cherne.net/brian/resources/jquery.hoverIntent.html)
My code below--
hoverIntent: This expands a row if you're cursor is over it and at the same time collapses all other rows.
$('.view-latest-new .views-field-field-story-lead-image-fid').addClass('expand');
var config = {
over: function() {
var expand = $(this).find(".expand");
if(expand.css("display") == "none")
{
$(".expand").slideUp("fast");
$(this).find(".expand").slideDown("fast");
}
},
out: function() {
}
};
$('.view-home .views-row').hoverIntent(config);
**EDIT:** Ajax:
var container = $('#content-inner');
$('#block-menu-secondary-links a').bind('click', function(){
var trigger = $(this);
var arg = trigger.attr('title');
doAjax(arg,container);
return false;
});
function doAjax(arg,container){
$.ajax({
url: 'views/ajax?view_name=home&view_display_id=page_1&view_args'+arg,
timeout:5000,
success: function(data){
var result = Drupal.parseJson(data);
updateContainer(result.display);
},
});
};
function updateContainer(content){
container.html(content);
$('.view-latest-new .views-field-field-story-lead-image-fid').addClass('expand');
$('.view-latest-new .views-row').hoverIntent(config);
}
Thanks!
**EDIT 2:** I've found a solution; by adding `$('.view-home .views-row').hoverIntent(config);` into the updateContainer function. I'm not sure if this is the best way to go about it though. But it works.