【问题标题】:jShowOff - Numeric links show 'undefined' ( in wordpress )jShowOff - 数字链接显示“未定义”(在 wordpress 中)
【发布时间】:2012-07-13 01:28:04
【问题描述】:

我搜索和搜索,我发现与这种情况相关的唯一一件事是 jQuery 低于 1.6,我相信 wordpress 已经超过了这一点......我在 Wordpress 网站上构建了一个 jShowOff 内容旋转器,并且我想有数字幻灯片链接,因为我认为它会默认显示,而是在每个链接中显示“未定义”......我尝试了一种解决方法,方法是制作一个计数器并给出该计数器的标题,就像一个魅力但是您将鼠标悬停在 Content Rotator 上,它会弹出计数器,因为标题 xD 看起来很丑陋……有什么想法吗?这是代码:

<div id="recentes">
                <?php $my_query = new WP_Query('category_name=oficiais&posts_per_page=7');
                    while ($my_query->have_posts()) : $my_query->the_post();
                    $do_not_duplicate[] = $post->ID; ?>
                    <div><p>
                    <?php the_post_thumbnail('recent-thumbnail',array('title' => "")); ?>
                    <span class="recentes_tit"><?php the_title(); ?></span><br /><p><?php $myExcerpt = get_the_excerpt();
                    $tags = array("<p>", "</p>");
                    $myExcerpt = str_replace($tags, "", $myExcerpt);
                    $myExcerpt = str_replace("<br />", " ", $myExcerpt);
                    echo $myExcerpt;
                    ?></p class="content_readmore"><a href="<?php the_permalink(); ?>">Ver artigo</a></p></div>
                <?php endwhile; ?>
                </div>
                <script type="text/javascript">
                    jQuery(document).ready(function(){ jQuery("#recentes").jshowoff({
                        autoPlay:true,
                        changeSpeed:1500,
                        controls:true,
                        effect:"slideLeft",
                        hoverPause:true,
                        speed:4500,
                    }); });
                </script>

仅供参考,假设我调用了 jShowOff css 和脚本 x) 提前谢谢你 =)

【问题讨论】:

    标签: jquery wordpress jquery-plugins


    【解决方案1】:

    我今天碰巧遇到了同样的问题。谷歌搜索并获得此链接:https://github.com/ekallevig/jShowOff/issues/38

    说:

    将 jquery.jshowoff.js 的第 231 行从 :

    var linktext = $(this).attr('title') != '' ? $(this).attr('title') : i+1;
    

    到:

    var linktext = $(this).prop('title') != '' ? $(this).prop('title') : i+1;
    

    在我的情况下这是有效的。

    【讨论】:

      猜你喜欢
      • 2014-10-07
      • 2011-11-11
      • 1970-01-01
      • 2020-08-08
      • 1970-01-01
      • 1970-01-01
      • 2014-09-24
      • 1970-01-01
      • 2019-04-12
      相关资源
      最近更新 更多