WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery Optimizer
[resolved] Change Fancybox titlePosition (10 posts)

  1. Blue Squirrel
    Member
    Posted 2 years ago #

    Hi

    Does anyone know how to change the position of the text that appears under the photo when it's opened up in a lightbox?

    All I wish to do is change titlePosition to "inside" but I just can't find where to do it!

    TIA

    http://wordpress.org/extend/plugins/nextgen-gallery-optimizer/

  2. Blue Squirrel
    Member
    Posted 2 years ago #

    Oh it's always good to answer your own question, so rewarding!

    That attribute is in "jquery.fancybox-1.3.4.pack.js" and is set as "float" change it to one of the other valid ones and you'll find that your uncle is called Bob.

  3. Blue Squirrel
    Member
    Posted 2 years ago #

    Oh it's always good to answer your own question, so rewarding!

    That attribute is in "jquery.fancybox-1.3.4.pack.js" and is set as "float" change it to one of the other valid ones and you'll find that your uncle is called Bob.

  4. Pradeep
    Member
    Posted 1 year ago #

    #Blue Squirrel, just wanted to say thanks. I still don't understand why they hide such a basic requirement, inside a JavaScript file. This functionality should be available to choose through the dashboard.

  5. Blue Squirrel
    Member
    Posted 1 year ago #

    Thank you very much Pradeep, that's very kind of you!

    I never dreamt that when I was talking to myself it would actually be useful to someone else.

    I'm glad it helped you (and I agree, if it's not in the dashboard it should at least be in the documentation).

  6. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    @ Blue Squirrel,

    Thanks for sharing your experiences!

    If you don't want to go digging around in Fancybox's compressed js file, you can easily modify the title style, and any of Fancybox's options by editing the "fancybox inline js" section at the top of Optimizer's scripts-and-styles.php.

    In the examples below, I've simply appended 'titlePosition':'inside' to Fancybox's invocation code (as required above), but you can also set 'titlePosition':'outside', 'titlePosition':'over' or 'titlePosition':'none' according to your preferences...

    For the basic version of Optimizer:

    /**********************************************************************
    * fancybox inline js
    **********************************************************************/
    
    function nggo_fancybox_inline_js() { ?>
    <!-- [nextgen gallery optimizer v<?php echo NGGO_VERSION; ?>] This page must contain a nextgen shortcode...else we wouldn't be serving its scripts and styles -->
    <script type='text/javascript'>jQuery.noConflict(); jQuery(document).ready(function() { jQuery('a.myfancybox').fancybox({ 'zoomSpeedIn':500, 'zoomSpeedOut':500, 'overlayShow':true, 'overlayOpacity':0.3, 'titlePosition':'inside' }); });</script>
    <?php
    }

    For the Premium version of Optimizer:

    /**********************************************************************
    * fancybox inline js
    **********************************************************************/
    
    function nggop_fancybox_inline_js() { ?>
    <!-- [nextgen gallery optimizer premium v<?php echo NGGOP_VERSION; ?>] This page must contain a nextgen shortcode...else we wouldn't be serving its scripts and styles -->
    <script type='text/javascript'>jQuery.noConflict(); jQuery(document).ready(function() { jQuery('a.myfancybox').fancybox({ 'zoomSpeedIn':500, 'zoomSpeedOut':500, 'overlayShow':true, 'overlayOpacity':0.3, 'titlePosition':'inside' }); }); var timer; jQuery(window).resize(function() { clearTimeout(timer); timer = setTimeout(jQuery.fancybox.browser_resize, 500); });</script>
    <?php
    }

    Hope this helps!

    Cheers,
    Mark.

  7. hmt3
    Member
    Posted 1 year ago #

    Used the Premium fix and it works great. However, when your plugin refers to "title" it connects to the "Description" section of the NextGen plugin. Is there a way to add the "Alt & Title Text" to the coding as well?

  8. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi hmt3,

    Thanks for downloading NextGEN Gallery Optimizer Premium!

    I've been looking into your question regarding the display of the Alt/Title text rather than the Description text in Fancybox, and I've come up with a solution for you. I believe the best method would be to use Fancybox's "titleFromAlt" feature, which will look for and use the text in NextGEN's Alt/Title field whenever the Description field is empty.

    I've just sent you through an email with an updated version of the plugin, which includes a modification to the Fancybox script itself (to enable compatibility with NextGEN). You'll just need to upload this to replace your existing copy, and add 'titleFromAlt':true to Fancybox's initialization code as above.

    I hope this helps!

    Cheers,
    Mark.

  9. hmt3
    Member
    Posted 1 year ago #

    That worked. Thank you very much.

  10. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi hmt3,

    That's great to hear! I'm glad I could help :)

    All the best with your site.

    Cheers,
    Mark.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic