vladax
Forum Replies Created
-
Forget the tag in the line of code above.
I see. As I said, I’m using Easy FancyBox with NextGEN Gallery. In the gallery settings all my photos on the page https://adamovsky.cz/fotky/voda have empty title. The space is given into the link title by the NextGEN plugin in the nggfunctions.php file with this line:
$picture->linktitle = ( empty($picture->description) ) ? <strong>' '</strong> : htmlspecialchars ( stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) );
IMHO if the title is empty or contains only white spaces the title bar should not be displayed.
BTW do you plan to support the new FancyBox2?
https://fancyapps.com/fancybox/Sure.
You can see the dark bar (a place for an empty title) at the bottom of these images:
Well – no answer to my post means I have to fix it for myself ??
The bug is in jquery.fancybox-1.3.4[.pack].js in this code:
titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); if (!titleStr || titleStr === '') { title.hide(); return; }
The “if” statement should hide the title bar if no title is available. The problem is that the first line will add a DIV tag to the titleStr even if there is no title. Therefore the titleStr will never be then equal to an empty string: ”. According to the plugin settings, in case of empty title the titleStr can contain:
'<div id="fancybox-title-over"> </div>' '<div id="fancybox-title-inside"> </div>' '<div id="fancybox-title-outside"> </div>' '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main"> </td><td id="fancybox-title-float-right"></td></tr></table>'
To correct this we should check the original object currentOpts.title. In best scenario with the trim function:
titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); if (!titleStr || $.trim(currentOpts.title) === '') { title.hide(); return; }