Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

running Jquery Code after Ajax

I am having some problems getting this part of my jQuery script to run after the Ajax – content switch...

/*no right click on img*/
 $('img').bind('contextmenu', function(e) {
 return false;
/*rollover*/
 $('.roll').on('mouseenter mouseout', function() {
 var original = $(this).attr('src');
 var replacement = $(this).data('hoverimg');
 $(this).attr('src', replacement).data('hoverimg', original);
 });
 });

Could someone please help me get it running I tried it whit a lot of Ideas, like:

var init = function(){
/*Code*/
}

Or

function init(){
/*Code*/
}

I am a bit confused right now.

Answer*

Draft saved
Draft discarded
Cancel

lang-js

AltStyle によって変換されたページ (->オリジナル) /