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

Keep a div poosition in the window fixed while scrolling

1 Answer 73 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wai Kei
Top achievements
Rank 1
Wai Kei asked on 04 Mar 2011, 03:08 PM
Hi Telerik,

    We have a need to fix a Telerik window size (cannot be resized or moved). Some content (a div with some text in it) inside the window needs to be keep in view while the Telerik window is scrolling up and down. I am trying to bind a scroll event to the Telerik window but it doesn't seem to be firing. I would believe it's just a "div" right? So I should be able to set the onscroll event on the window directly.

    <% Html.Telerik().Window()
        .Name("WindowCoding")        
        .Title(" ")
        .Draggable(false)
        .Scrollable(true)
        .Modal(false)
        .Content(() =>
            {%>
            <% Html.RenderPartial("~/Views/Shared/Input/ucLetterCoding.ascx", Model); %>
            <%})
        .Buttons(b => b.Maximize())
        .Height(400)
        .ClientEvents(events => events.OnResize("WindowCoding_OnResize"))
        .HtmlAttributes(new { onscroll = "onWindowCodingScroll()" })
        .Render(); %>

function onWindowCodingScroll() {
    alert("1234!");
}

But the onscroll event is not firing. I read that I need to make sure the div (the Telerik Window") has the overflow: auto css set. And I believe since I see the scrollbar on the right side of the Telerik Window. This property is already set.

What could I be doing wrong there?

Thanks,

Wai Kei

1 Answer, 1 is accepted

Sort by
0
Wai Kei
Top achievements
Rank 1
answered on 04 Mar 2011, 03:23 PM
I found the problem. I should be using "#WindowCoding .t-window-content" instead of just "#WindowCoding".
Tags
Window
Asked by
Wai Kei
Top achievements
Rank 1
Answers by
Wai Kei
Top achievements
Rank 1
Share this question
or