Hello
I’m hoping someone might be able to tell me the best way of approaching how to dynamically assign a background image to a span or div element.
Basically I want to create an image menu dynamically and then use simple CSS commands to create a ‘hover’ event (image shift).
I have pasted in my code below, if anyone has some suggestions it would be great - ideally I would like to achieve it without having to use third party add ons etc.
I have set the span element to display block in the pages external stylesheet.
…………...
<div class="folio-menu">
{exp:channel:entries channel="design_folio" orderby="random" sort="desc" limit="10" disable="member_data|categories" paginate="bottom" dynamic="no"}
<ul id="folio-menu-ul">
<li><a href="http://{url_title_path=folio/folio_single/}class=folio-menu-item"><span class="menu-item2"><span class="menu-item-name">{client_name}</span></span></a></li>
</ul>
{/exp:channel:entries}
</div>……………
This is how I achieved it by using a standard image element, but I can’t create the hover events etc.
<li><a href="http://{url_title_path=folio/folio_single/}class=folio-menu-item"><span>{folio_thumbnail}<span class="menu-item-name">{client_name}</span></span></a></li>Thanks all help gratefully accepted 😊