2016-11-27 88 views

回答

0

我得到了一個解決方案,添加工具欄fotorama畫廊。在初始化fotorama之後,需要爲gallery的工具欄添加html。

我)以下是我的自定義HTML代碼(我的圖片庫工具欄)

var fotoramaCustomToolbarHtml = '<span class="salon-name">'+salonName+'</span><img src="'+profileImage+'" class="profile-img"> \ 
    <span rel="tooltip" data-placement="top" \ 
    class="sf add-to-favourits add-to-favourits-gallery pull-left '+favouritsActiveClass+'" \ 
    data-id="'+salonId+'" data-isYelp="'+isYe+'" style=""> \ 
    <i class=" fa fa-heart" aria-hidden="true"></i> </span> \ 
    <input type="button" id="booking-fullscreen-btn" class="btn btn-default pull-right" \ 
    value="Book this salon" style="margin-top: 10px;"> '; 

II)初始化庫像往常一樣(我初始化我的自定義functionlities也)。您可以從http://fotorama.io/customize/api/

$('.fotorama').on('fotorama:ready', 
function (e, fotorama, extra) { 
bookingFromGallery(); // my custom functions that you don't need 
initTooltip(); // my custom functions that you don't need 
}).fotorama(); // initializing the fotorama gallery 

III)初始化圖庫之後發現任何其他活動需要追加自定義HTML

$('.fotorama').append('<div class="my-custom-fotorama-toolbar"><div class="fot-cus-tb-inner">'+fotoramaCustomToolbarHtml+'</div></div>');

然後我得到了解決&工作完美。

enter image description here

相關問題