To be honest I doubt many will this useful but in the rare case ..fill your boots.
Senario:
I am developing a site which requires a css class applied to the last item in a 'row' (it uses <ul><li> but best described as a row so you can visualize). In my case it was <li class="last">section item</li>
Because of this I had to set 'Column count for section lists' so every forth list item had class="last" applied to it.
Unfortunately the downside of this fixed method is that if section list items aren't perfectly divided my column count value (4) the <ul></ul> includes a number of empty <li></li> until column count is reached.
I'm sure a clever PHP guru can use php to do this which would be better method) but as I had jquery already on the page I included the following in the head of my outer layout:
Basically it looks for any empty li item and strips it.
You can modify to remove any html element you care to apply it to.
If you aren't using jquery already you'd be bonkers to use this method as you'd be adding a large javascript library to performa simple task, maybe PHP'ers can get to work,
Enjoy
Bangers
Senario:
I am developing a site which requires a css class applied to the last item in a 'row' (it uses <ul><li> but best described as a row so you can visualize). In my case it was <li class="last">section item</li>
Because of this I had to set 'Column count for section lists' so every forth list item had class="last" applied to it.
Unfortunately the downside of this fixed method is that if section list items aren't perfectly divided my column count value (4) the <ul></ul> includes a number of empty <li></li> until column count is reached.
I'm sure a clever PHP guru can use php to do this which would be better method) but as I had jquery already on the page I included the following in the head of my outer layout:
<script type="text/javascript">
jQuery(document).ready(function() {
$('li')
.filter(function() {
return $.trim($(this).text()) === ''
})
.remove()
});
</script>
jQuery(document).ready(function() {
$('li')
.filter(function() {
return $.trim($(this).text()) === ''
})
.remove()
});
</script>
You can modify to remove any html element you care to apply it to.
If you aren't using jquery already you'd be bonkers to use this method as you'd be adding a large javascript library to performa simple task, maybe PHP'ers can get to work,
Enjoy
Bangers