Facebox getting slower and slower when reopened, close buttons increasing, i think multiple Copies of Content

37 Views Asked by At

Facebox works fine and open faster when it is opened first time, but when i click on a facebox link second time, third time, it get slower & slower. First time, it show one cross/close button on top-right corner of facebox window, but it continue to increase close buttons when facebox is reopened. i.e. 2 close buttons when facebox opened second time and 3 when opened 3 times and so on. I think, it is opening multiple copies of content in facebox as it is becoming slower & slower each time it is reopened.

i have seen this post, but this related to any older version of facebox and not solving my problem. https://groups.google.com/forum/#!topic/facebox/9kjpTIznTzY

I have version 1.3 of facebox ( https://github.com/defunkt/facebox ). Reffering to the above post, I am seeing following code in facebox.js, i have pasted the code here which is as follows. Kindly please guide.

  reveal: function(data, klass) {
  $(document).trigger('beforeReveal.facebox')
  if (klass) $('#facebox .content').addClass(klass)
  $('#facebox .content').empty().append(data)
  $('#facebox .popup').children().fadeIn('normal')
  $('#facebox').css('left', $(window).width() / 2 - ($('#facebox   
  .popup').outerWidth() / 2))
  $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
},

close: function() {
  $(document).trigger('close.facebox')
  return false
 }
0

There are 0 best solutions below