Slideshow - Menucool
3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 7, 2015 (RSS)
I have a sildeshow that works, but requires the alt="" field of the image to be completed in order that a caption may be overlaid upon the photo in rotation as per http://www.menucool.com/slider/javascript-image-slider-demo1. I would like the [info1] and/or [info2] field to be inserted into this overlaid caption. The code I have thus far is below. Any help much appreciated.
Page is here - http://duncanbcrealestate.ca/~duncanbc/homes-details.php?Cowichan-Bay-Home-2
I would like to overlay the caption on large photos.
Ted
<div align="center">
<div id="sliderFrame" align="center">
<div id="slider" align="center">
<?php if ($homes_for_saleRecord['slideshow']): ?>
<?php foreach ($homes_for_saleRecord['slideshow'] as $image): ?>
<img src="<?php echo $image['thumbUrlPath'];?>" />
<?php endforeach ?>
<?php endif ?>
</div>
<div class="group1-Wrapper"> <a onClick="imageSlider.previous()" class="group1-Prev"></a>
<a onClick="imageSlider.next()" class="group1-Next"></a>
</div>
</div>
<center><img src="blackspacer.gif"><br>
<div id="thumbs"> <a onClick="imageSlider.previous()" class="group2-Prev"></a>
<a id='auto' onClick="switchAutoAdvance()"></a> <a onClick="imageSlider.next()" class="group2-Next"></a></div>
</center>
</div>
By rconring - March 7, 2015
I am not familiar with this particular slideshow script, but if all you need to do is echo the contents of the info1 field then simply add the alt attribute to the img tag and echo the contents of the info1 field within the quotes:
<img alt="<?php echo $image['info1'] ?>" src="<?php echo $image['thumbUrlPath'];?>" />
If the rendering script does not handle a blank alt attribute (alt=""), then you may have to conditionally display the alt attribute only if it contains data.
<?php if($image['info1']): ?>
<img alt="<?php echo $image['info1'] ?>" src="<?php echo $image['thumbUrlPath'];?>" />
<?php else: ?>
<img src="<?php echo $image['thumbUrlPath'];?>" />
<?php endif ?>
Hope this works for you!
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987
Thank you ... works with a bit of modification to css.
Much appreciated.