Embedding anchors within slideshow images

Page: 1

Author Post
Member
Registered: Jun 2012
Posts: 21
Hello,

I'm using floatbox on the home page of a gallery site to display a slideshow of representative images for artists. What I'd like to do is to embed a link to the associated artist's gallery within each image in the slideshow so that when the user sees an artwork they like they can click on it and navigate to that page.

The markup:

<div class="floatbox" rev="group:1 titleAsCaption:false endTask:loop navType:none
colorTheme:white roundCorners:none autoEndVideo:false modal:false cyclePauseOnHover:true
contextCloseOnClick:false showPlayPause:false doSlideshow:true randomOrder:true
pipIndexThumbs:false showIndexThumbs:false showItemNumber:false outsideClickCloses:false
showNewWindowIcon:false showClose:false enableDragMove:false minContentHeight:185
minContentWidth:185 stickyDragResize:false enableImageResize:false splitResize:true
startAtClick:false panelPadding:0 padding:0 outerBorder:0 autoStart:true
imageFadeDuration:5 resizeDuration:5">
<a href="images/img1.jpg"/></a>
<a href="images/img2.jpg"/></a>
<a href="images/img3.jpg"/></a>
<a href="images/img4.jpg"/></a>
<a href="images/img5.jpg"/></a>
<a href="images/img6.jpg"/></a>
<a href="images/img7.jpg"/></a>
<a href="images/img8.jpg"/></a>
<a href="images/img9.jpg"/></a>
</div>


So, for instance, when img3.jpg displays and the user clicks it, they will go to another page entirely. From what I've found searching the forum it looks like it might require creating a map, but I'm not too clear how to go about that.
Administrator
Registered: Aug 2008
Posts: 3382
One approach would be to place links to the artists' pages in the caption or caption2 of each gallery set member. Details for how to add html to the captions can be found in the captions section of the Instructions.

If you want the linking to be done based on a click or touch action on the actual image shown in the floatbox, I would suggest setting this up in an afterItemStart callback. Something like:
<a href="images/img3.jpg" rev="afterItemStart:`fb.fbContent.onclick = function() { window.open('http://somesite.com/'); }`" ></a>

To navigate within the same browser window, set location.href.
Member
Registered: Jun 2012
Posts: 21
Thanks, that snippet worked, although oddly, location.href wouldn't respond to clicks but location.replace would. No clue why that is.

So, the slideshow anchors now become:
<a href="images/img3.jpg" rev="afterItemStart:`fb.fbContent.onclick = function() { location.replace(&#039;some_other_page.html&#039;); }`"></a>
Administrator
Registered: Aug 2008
Posts: 3382
Of course, location.href is an assignment, not a function call
location.href = 'some_other_page.html';
Member
Registered: Jun 2012
Posts: 21
Ah, I see that now. In this case the function call may be preferable to avoid any possibility of 'redirection looping' on back navigation. Trying to be bullet-proof...

Page: 1