2016-08-18 129 views
0

我正在使用foogallery作爲我的畫廊頁面。點擊相應圖庫圖片的菜單將會顯示。最初當我加載畫廊頁面時,有空白空間。當我點擊菜單,然後可見和隱藏工作。隱藏顯示空白空間的Wordpress自定義畫廊可見性

以下是我的代碼。

<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] 有人請幫助我。

回答

0

錯誤代碼:

你試圖改變

<?=$_GET['id']> 

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

原始文件是正確的。我想當我對齊?不見了。這裏的問題是jQuery。 Onpageload想寫點東西。檢查這個鏈接,你可以理解這個問題。 http://imanagerprintingpress.com/gallery/ – premi