1

I have a jquery effect that manger hover events on images in a Data View Webpart. When the page loads the hovers work find in the table. But when I click next to paginate to the next set the hovers stop. What do I need to modify to have the effect continue to work after pagination?

$(document).ready(function () {
   $("img.ILikeItImg").hover(function(){
     $(this).attr("src", '/SiteAssets/facebook_like_buton.png');
    }, function() {
     $(this).attr("src", '/SiteAssets/facebook_like_buton_small_gray.png');
   });
})
  • This is very similar to this question: sharepoint.stackexchange.com/questions/39157/… – Steve Lineberry Jun 26 '12 at 11:56
  • yes similar but slightly different. I kluged a solution to the other question but this seems to be a very consistent issue which I am trying to get my arms around. Thanks for reading though. – ChiliYago Jun 26 '12 at 15:46
  • Which JS event did you find for the other solution? – Steve Lineberry Jun 26 '12 at 17:03
  • It seems that SharePoint ajax refresh of the data causes my entire jquery script to disappear!? I can see this in firebug script window as all of my code goes bye-bye on pagination. It is doing this on this page but not the other one referenced above. Very odd. – ChiliYago Jun 26 '12 at 22:39
  • Disabling ajax Asynchronous Update option on my list causes the page to reload and thus my jquery code to be reloaded. That will be my solution for now until we understand more. – ChiliYago Jun 26 '12 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.