Lightbox 2 and Impromptu Jquery plugin conflict

If you are using Lightbox 2 with Impromptu jquery plugin on the same page, your jquery code may fail whenever lightbox is activated.  My initial problem was I got the following error when Impromptu code was executed:

$.prompt is not a function

A fix for this is pretty straight forward, you simply place jQuery.noConflict() before the $.prompt line.

Example would be from this code:

     $.prompt(txt,{
         buttons:{Delete:true, Cancel:false},
         callback: function(v,m,f){
...etc.

To something like this:

     var $j = jQuery.noConflict();
     $j.prompt(txt,{
         buttons:{Delete:true, Cancel:false},
         callback: function(v,m,f){
//...etc.

Hope this helps someone with the same problem.

Leave a Reply