JeffLit
Posts: 6
Joined: Fri Oct 14, 2011 9:42 pm

Captions don't appear until 9th slide

Weird. I'm using thumb alts as captions. If I zoom into an image I don't see the caption. But if I arrow through 8 images then the captions start appearing and will appear for the previous 8 images now if I left arrow. If I close and reopen the images I will get captions all the time until I refresh the page, at which point they go missing again until the 9th image is viewed. What is going on here? See at http://365gtc4.com

Code: Select all

        hs.align = 'center';
        hs.transitions = ['expand', 'crossfade'];
        hs.wrapperClassName = 'rounded-white';
        hs.fadeInOut = true;
        hs.dimmingOpacity = 0.75;
        hs.captionEval = 'this.thumb.alt';

        // Add the controlbar
        if (hs.addSlideshow) hs.addSlideshow({
            interval: 5000,
            repeat: false,
            useControls: true,
            fixedControls: false,
            overlayOptions: {
                opacity: 0.8,
                position: 'top right',
                hideOnMouseOut: true
            }
        });

<a href="../Images/365gtc4_15859.jpg" class="highslide" onclick="return hs.expand(this)">
  <img src="../Images/365gtc4_15859_small.jpg" title="365 GTC/4 s/n 15859" alt="With a short run of only 500 units and a shorter wheelbase than the 2+2s before and after, the 365 GTC/4 was more modern and angular without being boxy. 365 GTC/4 s/n 15859 pictured.">
</a>
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Captions don't appear until 9th slide

You've got waaaaay too many things happening on that page, so debugging is damn near impossible. Comment out all of the other scripts and CSS files that are being loaded until you're down to just the gallery. There's no telling what kind of collisions you might be getting from the jQuery, bootstrap, chartjs, etc., etc. scripts that are all active on that page, to say nothing of the collection of CSS files (and one of those is being loaded twice).

However, I'm getting hints that the problem might be in the c4.css file, which includes this:

Code: Select all

#hsId1, #hsId2, #hsId3, #hsId4, #hsId5, #hsId6, #hsId7, #hsId8, #hsId9, #hsId10 {
    display: none;
}
Those ID's are created on the fly by Highslide JS, and that's where the captions are shown. You really don't want to be forcing them not to display.

(While you're at it, you've got an unholy mix of HTML5 and XHTML on that page. Pick one, preferrably the former, and stick to it. And why is the entire gallery in an HTML table?)
JeffLit
Posts: 6
Joined: Fri Oct 14, 2011 9:42 pm

Re: Captions don't appear until 9th slide

Despite the unholiness you figured it out. That was some old stupidity I had been messing around with in the css. The site is more than 10 years old and half asp.net and half not. I am in the process of refactoring to node and react but wanted to get some things fixed first, thus the mess (that said, I don't see any css file loading twice). Either way, I appreciate the review and the fast solution. Thanks.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Captions don't appear until 9th slide

The CSS being loaded twice is "../App_Themes/default/Default.css"

This is one of those cases in which the browser developer's tools came to the rescue. I could drill down and find the div ID that should be displaying the caption, but it was dimmed out. A hint! :mrgreen: Sure enough, there was some CSS causing it to be hidden.

I also had some mysterious disappearances of the control bar, but that, too, is placed into one of those "messed with" div ID's, so that was certainly coming from the same cause.

Return to “Highslide JS Usage”