View Full Version : Show file name being displayed

09-22-2012, 06:19 PM
1) Script Title: Reel Slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/reelslideshow.htm

3) Describe problem: How to display the file name of the picture being shown.

I would like to display the name of the file being shown in the slide in a label. I confirm that I sincerely searched for anyone who has asked for this solution but couldn't find any. Request help please..


09-22-2012, 06:58 PM
Use this modified version of the script (right click and 'Save As'):


That allows you to add this (highlighted) to your on page init:

<script type="text/javascript">

var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg"], //["image_path", "optional_link", "optional_target"]
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["http://i31.tinypic.com/119w28m.jpg"] //<--no trailing comma after very last image element!
displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},
onslide: function(){
jQuery('#imagename').html(this.setting.imagearray[this.curslide][0].replace(/^(.*\/|)([^\.]*)\.[^\.]*$/, '$2'));
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)


Notice the red id imagename, it will find an element on the page with an id of imagename and put the filename in there each time the slideshow slides. You can put that element anywhere you like. For example:

<div id="myreel"></div>

<div class="paginate">
= <a href="javascript:firstreel.navigate('back')" style="margin-right:200px;">back</a> <a href="javascript:firstreel.navigate('forth')">forth</a> =<br>
<span id="imagename">11l7ls0</span>

Notice that I've put the first filename in there (in green) so that it won't be empty while the slideshow and page are loading.

The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

09-22-2012, 07:59 PM
Works like charm. Thanks for the help. Really amazed by the speed of resolution. Will surely recommend this forum to my friends..