周末在写自己很不熟悉的css代码和js代码时候遇见了很多的问题,现在列举说一下(1)

 实现象csdn授页的那样的移动鼠标后可以变换内容效果

但是不是用的ajax,和由于数据要动态的读取.所以我的方法是

  < div  class = " activenews "  id = " con1 "  name = " con11 " >
                        
< asp:Repeater ID = " newsRepeater1 "  runat = " server " >
                             
< ItemTemplate >
                                     
< a href = " http://online.cumt.edu.cn/news/newsread.aspx?id=<%#DataBinder.Eval(Container,  " DataItem.newsid " )%> " >
                                  
<% #DataBinder.Eval(Container,  " DataItem.alttext " ) %> a >
                             
ItemTemplate >
                    
asp:Repeater >
                
div >
                
< div  class = " hiddennews "  id = " con2 "  name = " con12 " >
                
                     
< asp:Repeater ID = " newsRepeater2 "  runat = " server " >
                            
< ItemTemplate >
                                     
< a href = " http://online.cumt.edu.cn/news/newsread.aspx?id=<%#DataBinder.Eval(Container,  " DataItem.newsid " )%> " >
                                    
<% #DataBinder.Eval(Container,  " DataItem.alttext " ) %> a >
                             
ItemTemplate >
                    
asp:Repeater >
                
div >
                 
< div  class = " hiddennews "  id = " con3 "  name = " con13 " >
                         
< asp:Repeater ID = " newsRepeater3 "  runat = " server " >
                             
< ItemTemplate >
                                     
< a href = " http://online.cumt.edu.cn/news/newsread.aspx?id=<%#DataBinder.Eval(Container,  " DataItem.newsid " )%> " >
                                    
<% #DataBinder.Eval(Container,  " DataItem.alttext " ) %> a >
                             
ItemTemplate >
                    
asp:Repeater >
                 
div >
                
< div  class = " hiddennews "  id = " con4 "  name = " con14 " >
                     
< asp:Repeater ID = " newsRepeater4 "  runat = " server " >
                             
< ItemTemplate >
                                     
< a href = " http://online.cumt.edu.cn/news/newsread.aspx?id=<%#DataBinder.Eval(Container,  " DataItem.newsid " )%> "   >
                                   
<% #DataBinder.Eval(Container,  " DataItem.alttext " ) %> a >
                             
ItemTemplate >
                    
asp:Repeater >
                   
                    
                
div >

设置了4个,分别的读取一条记录来,那样就可以显示一个达到效果了,

利用的是改变对象的.classNam值来改变display属性

这样挺好的速度没一点影响到页面,

你可能感兴趣的:(.net编程)