Drop Shadow
| Project: | jQuery Eye Candy |
| Version: | 6.x-1.x-dev |
| Component: | jQuery plugin |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
This works great up until dealing with collapsible blocks. Then it leaves shadows in the original place.
Here is how I've applied it.
$(document).ready(function(){
$('#sidebars').dropShadow(); // Creates new drop shadows
$('#wrap').dropShadow();
$('#postarea').dropShadow();
$('.form-submit').dropShadow();
});
// the fix up
$(document).click (function(){
$(document).ready(function(){
$('#sidebars').redrawShadow(); //redraws shadows
$('#wrap').redrawShadow();
$('#postarea').redrawShadow();
$('.form-submit').redrawShadow();
validTags: ["div"]});
});
Now that works when you click the screen anywhere to redraw the shadows but fails on the collapsible blocks.
Is there a way to do this?
Also it seems to really muck up page scrolling, particularly on the modules page. The others didn't seem too bad but that page turns into a right dog.
Yani

#1
Yikes, I wouldn't use document.click. That would really suck on the module page especially if you have admin menu collapsing all those fields.
If you really want to dropshadow collapsible stuff, I'd rewrite your plugin to be:
$(.collapsible).click (function(){$('#sidebars').redrawShadow(); //redraws shadows
$('#wrap').redrawShadow();
$('#postarea').redrawShadow();
$('.form-submit').redrawShadow();
});
#2
http://drupal.org/node/205296
The suggested approach
Drupal.behaviors.myModuleBehavior = function (context) {
//do some fancy stuff
};
The current load
$(document).ready(function(){
// do some fancy stuff
});
If I read that right I should be calling the effects in a different way, if that is the case it could maybe be added to the modules help.
#3
Drupal.behaviors might be the better way to go for what you want to do. Behaviors will run and rerun which is important on an ajax page. However, I think it's beyond the scope of this module to incorporate behaviors.
This module is basically to add little eye candy touches here and there without having to write a module. A behavior is really much more than that.