What it is?A lightweight package of javascript, css and pngs for creating dropshadows on html objects.
How do I use it?First link to the javascript file:
Next, call our function. In practice you
... [More]
may want to bundle this into a generic onload handler, but for now, let's use a simple window.onload function:
window.onload=function(){
dropshadow(my_tag,my_class,my_inner_class);
}
We also need to customise our function call a little, to tell it:
What tags to target, What css classes to target, What classes to apply to the inside of our shadowed objects Like so:
dropshadow("div","dropme","dropped");Which will search our html for any div tags with class="dropme", apply the shadow and leave it with class="dropped", as used in this demonstration page (view source).
We can also use multiple calls:
dropshadow("div","dropme","dropped");
dropshadow("div","alsodropme","alsodropped");As used in this second demonstration page (view source).
What does it do?Firstly it wraps your tags in a set of nested divs. For example, this:
window.onload=function(){
dropshadow("div","dropme","dropped");
}
...will transform this:
Lorem ipsum...
...into this:
Lorem ipsum...
It then applies some css and semi transparent background images to all those ds-xx classes to produce a smooth ten pixel drop shadow.
IssuesIE6IE6 doesn't handle transparent PNGs, try: http://www.twinhelix.com/css/iepngfix/ [Less]