Perhaps sommin like this: (untested)

var clients =
[
'nike' : 'swoosh.jpg',
'addidas' : '3stripes.jpg',
'reebok' : 'rbk.jpg',
'default' : 'default.jpg'
];

var class = $("#main").attr("class");
typeof clients[class] != "undefined" ? insertImg(clients[class]) :
insertImage(clients['default']);

function insertImg(path) {
 $('#main').prepend('<img src="'+path+'"/>');
}

On Jul 11, 3:06 pm, brendan <[EMAIL PROTECTED]> wrote:
> On Jul 11, 9:51 am, noon <[EMAIL PROTECTED]> wrote:
>
> > Don't understand when this could occur to make any sense for images
> > being inserted like this without an example, but at any rate..
>
> noon, thanks for your help, I'll give it a try.
>
> I should have been a little more specific sorry. It's for displaying
> client testimonials, so if the client were, say, Nike; we'd want:
>
> <div id="main" class="nike">
> <img src=swoosh.jpg />
>
> Or
>
> <div id="main" class="adidas">
> <img src=3stripes.jpg />
>
> Or
>
> <div id="main" class="reebok">
> <img src=rbk.jpg />
>
> etc...

Reply via email to