1

Hi I'm trying to get this

$( "<div class=\"images\ style=\"background:url('" + item.link + "')no-repeat top center;\"/>").appendTo("#images").wrap("<a target=\"_blank\ href='" + item.link + "'></a>"); 

to output correctly but I'm not very hot on concatenating javascript strings. It's the line background div I can't get right.

cheers

Andy

1 Answer 1

1

Try

$( "<div class='images' style='background:url(" + item.link + ")no-repeat top center;'/>").appendTo("#images").wrap("<a target='_blank' href=" + item.link + "></a>"); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.