Child Jquery是否可以在无光泽页面上使用 [英] Does Child Jquery will work on maste page
本文介绍了Child Jquery是否可以在无光泽页面上使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
I have idea on how to create collapse and expand on div with jquery. I have usercontrol(.ascx) that contains asp.menu this control i am using in master page for left menu for this menu i want to implement collapse and expand feature like if click on header menu items should be expand so i have written jquery in usercontrol my doubt is does it work on master page if it is please modify my code.
Jquery:
<script src="~/_scripts/jquery-1.2.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("DIV.MenuGrid > DIV.top-outer > DIV.top-inner > DIV.ArrowExpand").toggle(
function () {
$("DIV.MenuGrid > DIV.top-outer > DIV.mid-outer > DIV.mid-inner > DIV.mid").show("slow");
$(this).attr("class", "ArrowClose");
},
function () {
$(this).parent().next("div.Content").hide("slow");
$(this).attr("class", "ArrowExpand");
});
});
</script>
Body:
<div class="MenuGrid">
<div class="rounded">
<div class="top-outer">
<div class="top-inner">
<div class="top">
<h2>Report</h2>
</div>
<div id="dvArrow" class="ArrowExpand"></div>
</div>
</div>
<div class="mid-outer">
<div class="mid-inner">
<div class="mid" style="height: auto">
<asp:Menu ID="menuTasksReports" runat="server" Orientation="Vertical" StaticDisplayLevels="1"
OnMenuItemClick="menuTasksReports_MenuItemClick">
<staticmenuitemstyle itemspacing="2" backcolor="#EAF4FF" font-size="12px" font-bold="True">
ForeColor="#006699" Width="200" BorderWidth="1" />
<statichoverstyle cssclass="Menu" />
<staticselectedstyle cssclass="Menu" />
<items>
</items>
</staticmenuitemstyle></div>
</div>
</div>
<div class="bottom-outer">
<div class="bottom-inner">
<div class="bottom">
</div>
</div>
</div>
</div>
</div>
推荐答案
(document).ready(function(){
(document).ready(function () {
("DIV.MenuGrid & gt- DIV.top-inner & gt; DIV.ArrowExpand).toggle( function(){
("DIV.MenuGrid > DIV.top-outer > DIV.top-inner > DIV.ArrowExpand").toggle( function () {
("DIV.MenuGrid & gt; DIV.mid-outer & ; gt; DIV.mid).show(" slow);
("DIV.MenuGrid > DIV.top-outer > DIV.mid-outer > DIV.mid-inner > DIV.mid").show("slow");
这篇关于Child Jquery是否可以在无光泽页面上使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文