0

I am using this library that allows you to create a more elegant alert box (you can even use images!); I used it with a click function and it works! A nice container opens with a close button, GREAT! I noticed if you happen to click more than once on the link you assigned, it keeps firing. So multiple images begin to propagate. I used the unbind method, but it cancels the link permanently (until refresh etc.).

I was surprised to see the library doesn't compensate for this little problem, so I am wondering if you could rebind the click when you close the image window so it starts from the beginning.

$(".shopFrag").click(function(){
  Messi.img("_images/wishlist.jpg");                              
  $(".shopFrag").unbind('click');
});
j0k
  • 22,600
  • 28
  • 79
  • 90
Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141
  • which library, which framework, which operating system? is this about a web-application? please fix your description and tags so people understand the context of your problem. – umläute Oct 01 '12 at 15:40
  • I was using JQuery and Messi[link](http://marcosesperon.es/)on OSX 10.8.2 inside a webpage. – Antonio Pavicevac-Ortiz Oct 01 '12 at 16:49

1 Answers1

2

There's a thread already open with this subject. If you're interested follow and read the solutions given:

How do I "rebind" the click event after unbind('click')?

Community
  • 1
  • 1
mram888
  • 4,899
  • 5
  • 33
  • 59
  • Someone on the JQuery forum suggested the following. $(".shopFrag").click(function(){ if ( !$("place selector here").length ) Messi.img("_images/wishlist.jpg"); }); – Antonio Pavicevac-Ortiz Oct 01 '12 at 17:05