1

I use a small script that hides/shows a pane when a certain element is clicked.

(function($) {
Drupal.behaviors.luminary = {
    attach: function (context, settings) {
         $(".toggle-visible").click(function () {
         var targetselector = $($(this).attr('data-target-selector'));
         targetselector.slideToggle("fast");
      });
    }
}
})(jQuery);

It works well, but when an ajax event occurs, the pane will slide visible, and immediately slide invisible again. It goes down, and comes right back up. It only happens after an ajax event. Any ideas?

1

Change

$(".toggle-visible").click(function () {

for

$('.toggle-visible').unbind('click').bind('click', function() {

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.