Wordpress自定义图库可见性隐藏显示空白区域

时间:2016-08-18 04:40:50

标签: jquery html css wordpress

我正在使用foogallery作为我的画廊页面。单击菜单将显示相应的图库图像。最初,当我加载图库页面时,有空白区域。当我点击菜单时,可见和隐藏正在工作。

以下是我的代码。

<div id="primarygal" class="content-area">
<div id="content" class="site-content" role="main">


 <div class="maincontentgal">
 <div class="leftcontent1">
 <div id="menu-item"> 
   <ul class="ca-menu">

     <li><a class="showSingle" target="1">
       <div class="cacontent">Advertisements</div></a></li>
         <li><a class="showSingle" target="2">
              <div class="ca-content">Books<span class="slashcolor">/</span>Journals <span class="slashcolor">/</span> Newsletters <span class="slashcolor">/</span> Magazines</div></a></li>
         <li><a class="showSingle" target="3"><div class="ca-content"> Brochures</div></a></li>
         <li><a class="showSingle" target="4"> <div class="ca-content">Calenders</div></a></li>
          <li><a class="showSingle" target="5"><div class="ca-content"> Forms <span class="slashcolor">/</span>Letter heads <span class="slashcolor">/</span> Certificates</div></a></li>
          <li><a class="showSingle" target="6"><div class="ca-content"> Greeting cards <span class="slashcolor">/</span> Invitations</div></a></li>
          <li><a class="showSingle" target="7"> <div class="ca-content">Labels <span class="slashcolor">/</span> Posters <span class="slashcolor">/</span> Product designs</div></a></li>
         <li><a class="showSingle" target="8"><div class="ca-content"> Leaflets <span class="slashcolor">/</span> Inserts</div></a></li>
         <li><a class="showSingle" target="9"><div class="ca-content"> Visiting cards</div></a></li>
          <li><a class="showSingle" target="10"><div class="ca-content"> Wedding cards</div></a></li>

       </ul>
    </div>
  </div>
   <div class="rightcontent1">
     <div class="featurette">
        <div class="gallRgt">

          <div id="div1" class="targetDiv" style="visibility:visible;">
                    <?php echo do_shortcode('[foogallery id="732"]');?>
           </div>
           <div id="div2" class="targetDiv" style="visibility: hidden;">
                     <?php echo do_shortcode('[foogallery id="743"]');?>
           </div>
           <div id="div3" class="targetDiv" style="visibility: hidden;">
                    <?php echo do_shortcode('[foogallery id="760"]');?>
           </div>
           <div id="div4" class="targetDiv" style="visibility: hidden;">
               <?php echo do_shortcode('[foogallery id="744"]');?>
            </div>
           <div id="div5" class="targetDiv" style="visibility: hidden;">
                <?php echo do_shortcode('[foogallery id="761"]');?>
           </div>
           <div id="div6" class="targetDiv" style="visibility: hidden;">
                <?php echo do_shortcode('[foogallery id="762"]');?>
           </div>
           <div id="div7" class="targetDiv" style="visibility: hidden;">
                   <?php echo do_shortcode('[foogallery id="763"]');?>
           </div>
           <div id="div8" class="targetDiv" style="visibility: hidden;">
                  <?php echo do_shortcode('[foogallery id="764"]');?>
           </div>
          <div id="div9" class="targetDiv" style="visibility: hidden;">
                    <?php echo do_shortcode('[foogallery id="765"]');?>
              </div>

         <div id="div10" class="targetDiv" style="visibility: hidden;">
                   <?php echo do_shortcode('[foogallery id="766"]');?>
        </div>


     </div>
  </div></div></div>
   </div><!-- #content .site-content -->
 </div><!-- #primary .content-area -->

 <?php
 if(!empty($_GET['id'])){
  ?>
   <script type="text/javascript">
         jQuery('.targetDiv').hide().css('visibility','hidden');
         jQuery('#div'+<?=$_GET['id']>.attr('target')).show().css('visibility','visible');
  </script>
  <?php

      }
      ?>
        <script type="text/javascript">

      jQuery(function(){ 

        jQuery('.showSingle').click(function(){ 
          jQuery('.targetDiv').hide().css('visibility','hidden');                                   jQuery('#div'+$(this).attr('target')).show().css('visibility','visible');
    });
});

以下是链接 [http://imanagerprintingpress.com/gallery/][1] 有人请帮助我。

1 个答案:

答案 0 :(得分:0)

错误代码:

你尝试改变

<?=$_GET['id']>

<?=$_GET['id']?>