2013-04-22 63 views
0

我想讓我的一組jQuery對話框按鈕中的一個按鈕顯示在左側。但我認爲這是不可能的,因爲jquery將按鈕組包裝在一個。我試着添加浮動:動態留下,但不起作用。將jquery對話框按鈕向左移動

任何想法?

感謝

<div class="ui-dialog-buttonset"> 
    <!--this should be on the left--> 
    <button id="lbCreateGroup" class="createButton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false"> 
    <!--these 2 buttons should be on the right--> 
    <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false"> 
    <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false"> 
</div> 

回答

1

你可以只用CSS做...

#lbCreateGroup { float: left; } 
.ui-button { float: right; } 

這裏的工作小提琴...

http://jsfiddle.net/tEKWJ/

默認情況下,所有的.ui-button類的元素將浮動到右側,所以你可能想要爲此專門添加另一個類。由id指定的元素的css將始終覆蓋由class指定的元素,因此您使用想要向左浮動的元素的id。

順便說一句,jQueryUI的可能正確的默認浮動按鈕,所以你可能不需要CSS 2號線:)

+0

這並沒有爲我工作...我不知道爲什麼。 – SkyeBoniwell 2013-04-22 15:01:06

+0

是否有任何鏈接到頁面的機會,或者是一個顯示你的問題的小提琴?我無法再現您的問題。 – Archer 2013-04-22 16:15:32

+0

我會盡量把它複製到小提琴......謝謝 – SkyeBoniwell 2013-04-22 16:39:20