【问题标题】:How to put NEXTGEN gallery description into PrettyPhoto jquery plugin in description or instead of social_tools如何将 NEXTGEN 画廊描述放入 PrettyPhoto jquery 插件的描述中或代替 social_tools
【发布时间】:2012-01-11 12:23:40
【问题描述】:

最近怎么样?所以我有这个问题,我无法弄清楚。

我使用 Wordpress,我在那里有一个 NextGen 画廊(最新的日期为 2012-01-11)和 PrettyPhoto jquery 插件(也是最新的日期为 2012-01-11),我都可以完美地工作,但我需要看看使用 PrettyPhoto 插件打开的每个图像下方的每个 NextGen 画廊描述。

$gallery 包含我们需要的所有东西,但它在 NextGen 文件夹中,我不知道如何将其拉出,除了编写 mysql SELECT 并从数据库中拉出所有内容,然后再次,不知道如何在这里做一个适当的循环。

这是链接:http://sinergijait.lt/alex/hittoak/photo-gallery/

这是我在 header.php 中使用的 prettyphoto 脚本:

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto({
            animation_speed: 'fast', /* fast/slow/normal */
            slideshow: 5000, /* false OR interval time in ms */
            autoplay_slideshow: false, /* true/false */
            opacity: 0.80, /* Value between 0 and 1 */
            show_title: true, /* true/false */
            allow_resize: true, /* Resize the photos bigger than viewport. true/false */
            default_width: 500,
            default_height: 344,
            counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
            theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
            horizontal_padding: 20, /* The padding on each side of the picture */
            hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
            wmode: 'opaque', /* Set the flash wmode attribute */
            autoplay: true, /* Automatically start videos: True/False */
            modal: false, /* If set to true, only the close button will close the window */
            deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
            overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
            keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
            changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
            callback: function(){}, /* Called when prettyPhoto is closed */
            ie6_fallback: true,
            markup: '<div class="pp_pic_holder"> \
                        <div class="ppt">&nbsp;</div> \
                        <div class="pp_top"> \
                            <div class="pp_left"></div> \
                            <div class="pp_middle"></div> \
                            <div class="pp_right"></div> \
                        </div> \
                        <div class="pp_content_container"> \
                            <div class="pp_left"> \
                            <div class="pp_right"> \
                                <div class="pp_content"> \
                                    <div class="pp_loaderIcon"></div> \
                                    <div class="pp_fade"> \
                                        <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
                                        <div class="pp_hoverContainer"> \
                                            <a class="pp_next" href="#">next</a> \
                                            <a class="pp_previous" href="#">previous</a> \
                                        </div> \
                                        <div id="pp_full_res"></div> \
                                        <div class="pp_details"> \
                                            <div class="pp_nav"> \
                                                <a href="#" class="pp_arrow_previous">Previous</a> \
                                                <p class="currentTextHolder">0/0</p> \
                                                <a href="#" class="pp_arrow_next">Next</a> \
                                            </div> \
                                            <p class="pp_description"></p> \
                                            {pp_social} \
                                            <a class="pp_close" href="#">Close</a> \
                                        </div> \
                                    </div> \
                                </div> \
                            </div> \
                            </div> \
                        </div> \
                        <div class="pp_bottom"> \
                            <div class="pp_left"></div> \
                            <div class="pp_middle"></div> \
                            <div class="pp_right"></div> \
                        </div> \
                    </div> \
                    <div class="pp_overlay"></div>',
            gallery_markup: '<div class="pp_gallery"> \
                                <a href="#" class="pp_arrow_previous">Previous</a> \
                                <div> \
                                    <ul> \
                                        {gallery} \
                                    </ul> \
                                </div> \
                                <a href="#" class="pp_arrow_next">Next</a> \
                            </div>',
            image_markup: '<img id="fullResImage" src="{path}" />',
            flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
            quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
            iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
            inline_markup: '<div class="pp_inline">{content}</div>',
            custom_markup: '',
            social_tools: '<div class="pp_social"><div class="need_gallery_desc_here" style="color:black"><?php echo 'need_gallery_desc_here' ?></div></div>'
        });
    });
</script>

你可以在prettyPhoto中看到,默认是social_tools块的地方:

social_tools: '<div class="pp_social"><div class="need_gallery_desc_here" style="color:black"><?php echo 'need_gallery_desc_here' ?></div></div>'

所以基本上我需要从 $gallery 或数据库本身中提取描述(数据库中的“galdesc”列)(不知道第一个是否可能)并创建一个显示画廊的循环该画廊的每张 prettyPhoto 图像的描述。

我希望它听起来不会太复杂。提前谢谢你。

最好的问候,亚历克斯。

【问题讨论】:

    标签: jquery loops prettyphoto nextgen-gallery


    【解决方案1】:

    要为您的图像添加描述,请使用标题属性。

    <ul class="gallery clearfix">
    <li><a href="images/fullscreen/1.JPG?lol=lol" rel="prettyPhoto[gallery1]" title="You can add caption to pictures. You can add caption to pictures. You can add caption to pictures."><img src="images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" /></a>
    </li>
    </ul>
    

    或者您可以个性化您的描述,例如 data-desc 属性。

    <a href="" rel="fotos[galeria]" data-desc="Description">Examinar en Mapa</a>
    

    然后在漂亮的照片源中你必须改变这一行

    pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){   if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).attr('data-desc')) ? $(n).attr('data-desc') : ""; }) : $.makeArray($(this).attr('data-desc'));
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-24
      • 2020-01-23
      • 2017-11-22
      • 2014-10-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多