2013-01-15 78 views
0

我在使用Fancybox 2.1.3在頁面加載時顯示一些文本。問題是,當我想讓它全部在一條線上時,它將它包裝到兩條線上。我試過寬度,autoSize和fitToView屬性,並且他們都沒有做任何事情。從包裝中防止Fancybox文本

我不想修改fancybox的css文件,因爲我也用fancybox來顯示一些圖像,並且這些工作正常。

的Javascript

<script type='text/javascript'> 
    $(document).ready(function(){ 
     // Activate fancyBox 
     $('.text').fancybox({ 
      padding : 0, 
      closeBtn : false, 
      topRatio : 0.75, 
      helpers : { 
       overlay: { 
       css: {'background' : 'rgba(0, 0, 0, 0.0)'} 
       } // overlay 
      } // helpers 
     }); 
     // Launch fancyBox on first element 
     $('.text').eq(0).trigger('click'); 
     // Close automatically 
     setTimeout('parent.$.fancybox.close();', 10000); 
    }); 

HTML

<a href='#textid' class='text'></a> 
<div style='display: none'> 
    <div id='textid'>The display text goes here.</div> 
</div> 

CSS

#textid 
    { 
    font-size: 40px; 
    color: red; 
    } 

回答

0
#textid { 
    font-size: 40px; 
    color: red; 
    white-space: nowrap; 
}