2010-09-19 75 views
1

我有以下CSS將整個事件顯示爲「已完成」。具有不同CSS的事件項目

.afc-completed, 
    .fc-agenda .afc-completed .fc-event-time, 
    .afc-completed a { 
     color: yellow;   /* text color */ 
     background-color: #6C3; /* default BACKGROUND color #36c */ 
     text-decoration: line-through; 
    } 

我該如何編寫一個僅用於更改fc-event-title的CSS? 我看到我的課程afc-completed已被添加到<div>元素,但我沒有找到解決方案來更改標題(fc-event-title)或時間。

這裏有什麼幫助嗎? Günter

+0

你還沒有一個fc事件標題。然而,只需將它放在css的底部:'.fc-event-title {background-color:red; }'或類似的,它應該工作。 – 2010-09-19 10:44:23

回答

0

如果您發佈了一些標記,我可以給出更好的答案,但在一般情況下,您需要爲樣式表添加一個附加規則,該規則適用於fc-event-title類的元素。事情是這樣的:

.fc-event-title 
{ 
    color: #ff0000; /* change the color values to something more appropriate */ 
    background-color: #00ff00; 
    text-decoration: line-through; 
} 
0

@wsanville & @Thomas

我認爲這不是那麼簡單,對不起。 只是定義什麼wsanville說將改變爲所有事件。重點是僅針對「已完成」事件進行更改。 對於我

if (newEvent.completed != null) { 
    newEvent.className = "afc-completed"; 
} 

但這隻能是怎麼回事到div,而不是所有權。 我想我只需要直接添加一個類到/或而不是「.fc-event-title」,僅僅是選擇/完成的事件,而只是添加到標題中。 下面是一個典型的div:

<div style="position: absolute; z-index: 8; left: 144px; width: 135px; top: 40px;" 
    class="fc-event fc-event-hori fc-corner-left fc-corner-right afc-completed "> 
    <a><span class="fc-event-time">15:15 - 16:15<br></span> 
     <span class="fc-event-title">Fri Dille</span> 
    </a> 
    <div class="ui-resizable-handle ui-resizable-e" unselectable="on" 
     style="-moz-user-select: none;"> 
    </div> 
</div> 

newEvent.className不喜歡的工作! 還有另一種可能嗎?

而且我需要對事件演示文稿進行更多修改,如附加圖標或帶有斜體的文本......以及這些「選項」的不同組合。

感謝您的幫助。 岡特

0

OK,這裏是一個可行的解決方案,以解決 「重要」 和 「完成」 事件的屬性:

newEvent.className = ((newEvent.completed != null)? "afc-completed " : "") 
    + ((newEvent.priority != null) ? "afc-important " : ""); 

.afc-completed .fc-event-title { 
    color: yellow; 
    background-color: #A6B5BC; /* grey */ 
    text-decoration: line-through; 
    } 
.afc-important .fc-event-title { 
     color: #C00 !important; 
     font-weight: bold !important; 
    } 

感謝您的幫助;)

相關問題