Posted by st53182 on May 21, 2011 at 12:25pm
Hello professionals,
I need some help with module Panel Collapse
Shortly about the situation:
I am using Views+Ctools+Panels+Panel Collapse, the idea is to create a menu with Panel Page.
if (Drupal.jsEnabled) {
$(document).ready(function(){
var defTbodyDisplay = $('tbody').css('display');
$('div.panel-display div.panel-pane-collapsible').each(function(){
$(this).find('th.views-field-title').mouseover(function(){
$(this).toggleClass('collapsed');
$(this).parent().parent().parent().children('tbody').toggleClass('collapsed').slideToggle('normal',
function(){
if(! $(this).hasClass('collapsed')) {
$(this).css({'display': defTbodyDisplay});
}
});
});
});
});
}The problem is that the basic state of panel is opened, but i need that from the beginning it was already closed, and only after the
mouseover event it opened.
tsi.sydex.ru - the test site with this problem.
Comments
What about .hover()
What about the .hover() method? Something like this:
Drupal.behaviors.myNameSpace = function (context) {$('tbody').show();
$('div#panel div.panel-pane-collapsible').hover(
function(){
$(this).addClass('collapsed');
},
function(){
$(this).removeClass('collapsed');
}
);
}