views:

411

answers:

2

Hello, I'm using Jquery plugin DropShadow: web site

And I want to set drop shadow color manually.

Color is specified in the usual manner, with a color name or hex value. The color parameter does not apply with transparent images.

From documentation, so, here is my code:

{
   ...
   color: "black",
   swap: false
}

It works perfect, with '#000' against 'black' it works too... But if I need shadow color, for example, red '#fff000' plugin doesn't work. I don't see any shadow. Why?

A: 

The plugin uses css("background", opt.color) to set the shadow colour - this is a correct and straightforward jQuery method which should work.

I suspect you're not specifying the dropShadow options correctly. If you could include in your question the a sample of your call to the dropShadow plugin this hypotesis could be either proved or discarded.

If you don't specify a colour, the default 'black' is used. If you instead specify the colour as '#000' (the hex representation for black) you'll not be able to tell if you're correctly specifying the desired colour and correctly overriding the in-built default.

According to the documentation, you would need to specify the options as:

$.dropShadow({
    color:'<your colour here>'
});

For red you would need to use:

$.dropShadow({
    color:'#f00'
});

Include in your question the relevant call to $.dropShadow() if this doesn't work.

Jon Cram
A: 

I have created my own solution with four lines of jquery code:

http://sarfraznawaz.wordpress.com/2010/03/16/drop-shadow-effect-with-four-lines-of-jquery-code/

Sarfraz