Designers Sanctuary vs Slicers NightmareAdd to My Brief

Vince Scordino | 22/02/2010

They’ve done it again haven’t they? You’ve just been briefed on a new project, had a peek at the designs and it’s drop shadow-ville! Never fear, jQuery is here.

Whilst I was recently slicing a site, I was confronted with some funky gradients and drop shadows. Now don’t get me wrong, these features really do bring out a design, however deem tricky and fiddly to slice. It was this repetitive slice procedure that made me Google around for a quicker alternative that could be reused (even by a CMS for clients).

jQuery has a nifty wrap() function which takes in a string or object to generate a structure wrap of HTML around the matched elements. With this wrap() function, we could use some nested sliced DIV’s with gradient backgrounds to create a shadow effect wrapped around an image. 

Reference for background images: http://15daysofjquery.com/examples/osds/ 

 

Therefore, after placing a class of dropshadow on any image requiring a drop shadow, the output HTML would render as:

Example:

 

 

tags: Web Development

Interested in learning more?

Wiliam is a leading supplier of web solutions and can provide expert advice to assist your business or organisation online.

Make enquiry   Request quotation

Comments

Share this page

Print this page Email this page to a friend Bookmark and Share

No Brief added yet.

My Brief results-driven approach emphasises a commitment to our clients needs through strategic analysis and best-practice.

Add to My Brief

Click on this icon to save item into My Brief. Retrieve, email and print

Drag & Drop

Drag & drop any iten with this icon into My Brief. Retrieve, email and print

Search Blogs