I am thinking this should be a simple change that I'm trying to do, but I'm missing something.
I have a website running on Drupal 7 that I'm building, and for one of the tools (modules), it creates a toolbar that shows at the top of the screen. I found some custom code that hides it by default, and shows it when you press the tilde (~) key on your keyboard.
I would rather it show by default, and then show or hide when I press the tilde.
Is this possible to change? I tried a little so far, but I know I'm missing something.
Here's the original:
All I've tried doing so far is swapping ....hide(); with ....slideToggle..
Well, that didn't work out so well... when I did that, it would slowly hide when loading the site, and then I couldn't get it to show at all.
Can anybody help me sort this out to where it will show by default, and only hide upon the keypress?
Thanks for any help here. Javascript is not something I've really delved into before.
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
I have a website running on Drupal 7 that I'm building, and for one of the tools (modules), it creates a toolbar that shows at the top of the screen. I found some custom code that hides it by default, and shows it when you press the tilde (~) key on your keyboard.
I would rather it show by default, and then show or hide when I press the tilde.
Is this possible to change? I tried a little so far, but I know I'm missing something.
Here's the original:
Code:
/***************************************************************************************************
* Found the following piece from [URL unfurl="true"]http://mrtheme.com/cms/drupal/drupal-7-pimping-admin-menu-module/[/URL]
* installed 20111210 by manually pasting author's code
***************************************************************************************************/
Drupal.admin.attachBehaviors = function (context, settings, $adminMenu) {
$adminMenu.find('> div').hide();
$(window).bind('keypress', function(e) {
var kcode = (e.which);
if(kcode == '96') {
$adminMenu.find('> div').slideToggle('slow');
}
});
}
All I've tried doing so far is swapping ....hide(); with ....slideToggle..
Well, that didn't work out so well... when I did that, it would slowly hide when loading the site, and then I couldn't get it to show at all.
Can anybody help me sort this out to where it will show by default, and only hide upon the keypress?
Thanks for any help here. Javascript is not something I've really delved into before.
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57