Hi, I’ve not tried doing anything like the below before, plus rubbish at Javascript so please excuse newbie’ness!
Here’s my code:
{if "{bg-images:total_rows}" > 0}
<div id="supersized"></div>
[removed][removed]
[removed]
// initialise plugins
$(document).ready(function() {
/* Supersized background images */
$.fn.supersized.options = {
startwidth: 1000,
startheight: 750,
vertical_center: 1,
slideshow: 1,
transition: 1,
slide_interval: 8000,
slides : [
{bg-images}
{if row_count != total_rows}{image : '{img}'},{/if}
{if row_count == total_rows}{image : '{img}'}{/if}
{/bg-images}
]
};
$('#supersized').supersized();
// Validate Plugin
$(function() {
$("form").validate();
});
});
[removed]
{/if}I’m basically testing to see if the bg image entry is the last item in the Matrix and if it is, don’t display the trailing comma, as this screws up in IE. If I put the following code loop outside the javascript is works fine, so I presume it’s a confliction between the JS and EE code.
Here’s the loop/test in question:
{bg-images}
{if row_count != total_rows}{image : '{img}'},{/if}
{if row_count == total_rows}{image : '{img}'}{/if}
{/bg-images}If anyone could help, I’d really appreciate it.