2014-09-29 37 views
0

我想建立一個使用WordPress的網站,我有一個插件是幫助在圖像上創建一個熱點(54.165.58.29/dahlia/這是網頁)。我無法將標題顯示在圖像的彈出式顯示中。WordPress的花式框標題不顯示

這是這裏的代碼。

$_ = jQuery.noConflict(); 
$_(document).ready(function() { 
     $_("a[rel=map_gallery]").fancybox({ 
      'transitionIn'  : 'none', 
      'transitionOut'  : 'none', 
      'titlePosition'  : 'inside', 
      'titleFormat' : function(title, currentArray, currentIndex, currentOpts) 

{ return '<span id="fancybox-title-inside">Image ' + (currentIndex + 1) + ' of ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>'; 
} 
});          
}); 

我已經用盡了很多小時了。

回答

1

您需要將標題屬性添加到您的代碼中的每個標籤,以供選擇它。

<a id="197_mark_image_1" href="http://54.165.58.29/wp-content/uploads/2014/06/MB2.jpg" class="btn" rel="map_gallery" style=" position: absolute; top:39px; left:152px; " title="My image title"> 
    <!--img src="http://54.165.58.29/wp-content/plugins/floorplan-generator/images/camera-button.png" /--> 
    <div onclick="addToFancyboxWrap(this)" style=" width: 30px;height: 30px;-moz-border-radius: 50px;-webkit-border-radius: 50px;border-radius: 50px;color: #fff;"><img src="/wp-content/uploads/2014/08/circle_pink_hotspot2.png"></div></a>