Dynamic second-level column and sliding effect

Source: Internet
Author: User

Front-end page and JS:

 

<Asp: repeater id = "rptmenu" runat = "server"> <br/> <itemtemplate> <br/> <Div class = "help_td1" id = "d <% # getnum () %> "onmouseover =" <% # getnum2 () %> "onmouseout =" changethis (this) "onclick = '<% # getonclick (convert. toint32 (eval ("ID") %> '> <br/> <a href = "/help/index. aspx? Kind = <% # eval ("mce_href =" Help/index. aspx? Kind = & lt; % # eval ("ID") %> & WUC = more & F = <% # getnum3 () %> "> <br/> <% # eval (" name ") %> <br/> </a> <br/> </div> <br/> </itemtemplate> <br/> </ASP: repeater> <br/> <MCE: script language = "JavaScript" type = "text/JavaScript"> <! -- <Br/> var url = Window. location. search; <br/> var Pos = URL. lastindexof ("F ="); <br/> var urlgg = URL. substring (Pos + 2, URL. length) </P> <p> var olddiv = document. getelementbyid ("d1"); <br/> var dd; <br/> If (Pos> 0) <br/>{< br/> olddiv = document. getelementbyid (urlgg); <br/> dd = document. getelementbyid (urlgg); // currently selected <br/>}</P> <p> olddiv. classname = "help_td2"; <br/> function changebg (DIV) <br/>{< br/> div2 = Doc Ument. getelementbyid (DIV); // slide item <br/> // If (div2! = Olddiv & div2.classname = "aboutus_td1") <br/> // {<br/> If (DD! = Olddiv) <br/>{< br/> olddiv. classname = "help_td1"; <br/>}< br/> If (div2! = Dd) <br/>{< br/> div2.classname = div2.classname = "help_td2 "? "Help_td1": "help_td2"; <br/>}</P> <p> olddiv = div2; <br/>/}< br/>}< br/> function changethis (DIV) <br/>{</P> <p> If (DD! = Div) <br/>{< br/> Div. classname = "help_td1"; <br/>}< br/> else <br/>{< br/> Div. classname = "help_td2"; <br/>}< br/> function onclickthis (ID, f) <br/>{< br/> window. location. href = "/help/index. aspx? Kind = "+ ID +" & WUC = more & F = D "+ F; <br/>}</P> <p> // --> </MCE: SCRIPT>

Background. CS code:

Private void bindmenu ()
{
CMS. BLL. newskindmanage Km = new CMS. BLL. newskindmanage ();
Arraylist Al = km. getchildkindlist (195 );
Km. sortfield = "sort ";
This. rptmenu. datasource = Al;
This. rptmenu. databind ();
Al. Clear ();
Km. Dispose ();
}
Int I = 1;
Public int getnum ()
{
Return I ++;
}
Int J = 1;
Public String getnum2 ()
{
Return "changebg ('d" + J ++ "')";
}
Int K = 1;
Public String getnum3 ()
{
Return "D" + (K ++ );
}
Int L = 1;
Public String getonclick (int id)
{
Return "onclickthis (" + ID + "," + (L ++) + ")";
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.