2012-09-22 40 views
0

我想設置兩個標題框的fancybox iframe.I'm使用版本1.3.4這我目前得到。fancybox中的兩個標題?

enter image description here

這是相關的源代碼:

$(document).ready(function() { 
     $("a.group").fancybox({ 
      'zoomSpeedIn'   : 600, 
      'zoomSpeedOut'   : 500, 
      'easingIn'    : 'easeOutBack', 
      'easingOut'    : 'easeInBack' 

     }); 

$("a.iframe").fancybox({ 
     'titlePosition' : 'over', 
      'showCloseButton' : false, 
      'titleShow'   : true, 
      'scrolling'   :'no', 
      'width'  : 650, 
      'height'  : 660, 
      'autoScale'   : false, 
      'transitionIn'  : 'none', 
      'transitionOut'  : 'none', 
      'type'    : 'iframe', 
      'hideOnOverlayClick': false, 
      'hideOnContentClick': false, 
      'enableEscapeButton': false 
     }); 
    }); 

但我想有我收藏的底部相同的標題框而不刪除其中一個是在頂部它。所以我在fancybox css中創建了另一個屬性:

.fancybox-title-over1 { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    color: #FFF; 
    text-align: left; 
} 


#fancybox-title-over1 { 
    padding: 10px; 
    background-image: url('mybottomtitlebackground.png'); 
    display: block; 
} 

但我不知道如何在我的lightbox上顯示它。

非常感謝您的協助!

+0

你能提供一個小提琴,顯示的fancybox,因爲它目前爲?你可能只需要使用jquery克隆這個元素並將其正確定位,但是如果你能提供一個小提琴,它會更容易分辨。 –

+0

謝謝你的回答。這裏是jsfiddle:[鏈接](http://jsfiddle.net/a65ZN/) – user1690815

回答

0

如果我正確地理解你的問題,你可以克隆的標題,然後它在底部位置:

var title = $(".fancybox-title-over"); 
title.css({'top':'0px', 'bottom':'auto'}); 
var p = $(".fancybox-title-over").parent(); 
var x = $(".fancybox-title-over").clone(); 
p.append(x); 
x.css({"top":"auto","bottom":"0", "position":"absolute"}); 

更新小提琴:http://jsfiddle.net/a65ZN/11/

+0

這正是我需要的,謝謝你的幫助! – user1690815