2011-05-10 76 views
0

我有三個單選按鈕:彈出DIV當鼠標懸停在單選按鈕

  • 左浮動
  • 浮動權

所以當通過無線電用戶鼠標懸停/懸停按鈕我只想預覽div。

<asp:radiobuttonlist runat="server" id="rbl" repeatdirection="Horizontal"> 
    <asp:listitem text="None" value="0" selected="True" enabled="true"/> 
    <asp:listitem text="Float Left" value="1" selected="False" enabled="true"/> 
    <asp:listitem text="Float Right" value="2" selected="False" enabled="true"/> 
</asp:radiobuttonlist> 

這裏是div:

<div id="divid"> 
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam non justo at est sodales molestie vitae id ligula. Proin sed consequat augue. Donec neque nibh, laoreet vel laoreet non, dignissim id lectus. Maecenas pulvinar pretium leo, quis pharetra odio pulvinar at. Integer tincidunt orci eget velit consectetur suscipit. Nullam in augue ut felis volutpat cursus. In mi augue, accumsan vel laoreet nec, scelerisque vitae nibh. Sed quis dolor quam, nec rhoncus lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras varius luctus nulla vel dapibus. Donec aliquam vehicula tincidunt. Suspendisse potenti. Donec at odio lorem. Nam aliquam rhoncus aliquam. Sed posuere tincidunt purus non tristique. 
</div> 
+0

這很沒道理。你能重寫這個問題嗎? – jessegavin 2011-05-10 15:06:51

+0

只是更新我的問題,現在有道理? – 2011-05-10 15:11:17

回答

0
$('#<%= rbl.ClientID %>:radio').hover(
    function(){ 
     $('#divid').toggle(); 
    }, 
    function(){ 
     $('#divid').toggle(); 
    } 
); 

Working demo

demo using ui dialog

new demo似乎與關閉對話框麻煩所以我評論它現在

+0

很難回答從iPhone – mcgrailm 2011-05-10 15:23:26

+0

問題我爲你重新格式化,並添加了asp代碼,將插入適當的ID名稱爲該控制。 – jessegavin 2011-05-10 15:30:13

+0

感謝您的努力mcgrailm – 2011-05-10 15:31:02

0

這是你以後?

$("input[name='<%= rbl.ClientID %>']").hover(
     function() { $("#divid").toggle(); } 
); 

沿着這些線:Demo

+0

我剛剛更新了我的問題,更新:彈出預覽,當懸停/ mouseover我想顯示爲彈出預覽 – 2011-05-10 15:30:24

0

這是否滿足你的要求嗎?

$(":radio[name='rbl']").hover(function(){ 
    $("#divid").css({ 
     display: "block", 
     position: "absolute", 
     left: ($(this).offset().left + $(this).width()) + "px", 
     top: $(this).offset().top + "px" 
    }); 
}, 
function(){ 
    $("#divid").hide(); 
}); 
+0

不起作用,當我懸停或單擊單選按鈕時不顯示任何內容 – 2011-05-10 17:17:11