<div id="js1" style="overflow:hidden; left:114px; top:600px; width:810px; height:300px; z-index:0">
<div align="center" id="c_js1" style="overflow:hidden;height:100%;width:100%;">
<div id="p1_js1">
/// your datalist code
<asp:DataList ID="DataList1" runat="server" Width="627px" >
<ItemTemplate>
<div id="selector2">
<div id="div1" style="padding-left:5px;">
<asp:Label ID="label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SE_eventname")%>' ForeColor="#0099CC" Font-Bold="true" Font-Size="Medium"></asp:Label>
</div>
<div id="div2" align="center">
<asp:TextBox ID="txt1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SE_eventdetails")%>' Style="overflow: hidden;resize:none;" Height="30px" TextMode="MultiLine" Width="95%" MaxLength="100" BorderStyle="None" ></asp:TextBox>
</div>
<div id="div3" align="right" style="padding-right:5px;">
<asp:LinkButton ID="LinkButton1" CommandName="view" runat="server">View more</asp:LinkButton>
</div>
</div>
<asp:Button ID="hiddenbutton" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem, "SE_postid")%>' runat="server"/>
<br />
</ItemTemplate>
<AlternatingItemStyle BackColor="White" />
<ItemStyle BackColor="#FFFBD6" ForeColor="#333333"/>
<SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
</asp:DataList>
<br>
</div>
<div id="p2_js1"></div>
</div>
<script language="javascript" type="text/javascript">
var speed=30
var i=0
var n=Math.floor(js1.offsetHeight/p1_js1.offsetHeight)
for (i=0;i<=n;i++)
{
p2_js1.innerHTML+=p1_js1.innerHTML
}
function m_js1()
{
if(c_js1.scrollTop<=p1_js1.offsetTop)
c_js1.scrollTop+=p1_js1.offsetHeight
else{
c_js1.scrollTop--
}
}
var mm_js1=setInterval(m_js1,speed)
c_js1.onmouseover=function(){clearInterval(mm_js1)}
c_js1.onmouseout=function(){mm_js1=setInterval(m_js1,speed)}
</script></div>
thats it.........! it ll scroll the content of the datalist from top
No comments:
Post a Comment