This is a migrated thread and some comments may be shown as answers.

Hide radnotification on click when VisibleTitlebar="false"

2 Answers 176 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Saranya
Top achievements
Rank 1
Saranya asked on 09 Dec 2013, 07:41 AM
Hi,

I am trying to hide the notification when a user clicks anywhere on it - when the title bar is off. 
I can use JQuery and have tried :

Setting OnClientClicked="test"

function test() {
                alert("hahaha");
            }

Next tried 

$('#' + "<%=radNotification.ClientID%>").click(function () {
                             alert("ho ho ho");
 
                         });

    Next tried OnClientShown=OnClientShown
function OnClientShown(sender, args) {
                         $(sender).click(function () {
                             alert("ho ho ho");
                         });
                     }

Then tried Class = "NotificationTest"

   $('.NotificationTest').click(function () {
                            alert("ho ho ho");
                        });  
 
and even
 
$('.RadNotification .RadNotification_Default .SLANotification .rnNoTitleBar').click(function () {
                            alert("ho ho ho");
                        });

But none of this is working. Please help.
Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Dec 2013, 08:35 AM
Hi Saranya,

Please have a look into the following code snippet to hide the RadNotification on clicking it.

ASPX:
<telerik:RadNotification ID="RadNotification1" runat="server" Title="Notification Title"
    ShowCloseButton="false" VisibleTitlebar="false" Text="RadNotification is a light control which can be used to display a notification message"
    VisibleOnPageLoad="true">
</telerik:RadNotification>

JavaScript:
<script type="text/javascript">
    $(document).ready(function () {
        $('.rnContent').click(function () {
            var notification = $find("<%=RadNotification1.ClientID %>");
            notification._close(true);
        });
    });
</script>

Thanks,
Shinu.
0
Saranya
Top achievements
Rank 1
answered on 09 Dec 2013, 10:30 AM
Thanks! That worked 
Tags
Notification
Asked by
Saranya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Saranya
Top achievements
Rank 1
Share this question
or