I'm trying to keep a child DIV from extending over the parent....the DIV in question is the one seen below labeled with id="2".....it goes past the parent DIV and goes all the way to the bottom of the page/browser window. I've modified the height, adding padding, changed location of the DIV and nothing works....not sure what to try next:
<div id="2" style="width:15%; height:90%; padding:10px; background-color:#2A7FAA; float:right; margin-top:200px"></div>
<div style="background-color:#FFF; border:thick; border-width:thick;">
<div style="margin-left:250px;">
<img style="padding:2em;" alt="ASH Banner" src="images/banner.png" class="banner"> <img style="padding:2em;" alt="ASH Banner" src="images/dsh-logo.png" class="logo">
</div>
</div>
<div style="height:15px; background-color:#2A7FAA"></div>
<div style="margin-left:150px; background:#CCC">
<div class="dropdown">
<button class="dropbtn" style="background-color:transparent">HOME
</button>
</div>
<div class="dropdown">
<button class="dropbtn" style="background-color:transparent">PERSONNEL
</button>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
<div class="dropdown">
<button class="dropbtn" style="background-color:transparent">INSURANCE
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
<div class="dropdown">
<button class="dropbtn" style="background-color:transparent">WORKERS COMP
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
<div class="dropdown">
<button class="dropbtn" style="background-color:transparent">EMPLOYMENT<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
<div class="dropdown">
<button class="dropbtn" style="background-color:transparent">BENEFIT PREMIUMS<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
</div>
<hr / style="border-width: 2px; width:800px; margin-right:9em;">
<div style="margin-top:3em">
<div style="width: 800px; margin: 0 auto;">
<p>Text Goes Here Text Goes Here Text Goes Here</p>
</div>
</div>
<div style="width: 800px; margin: 0 auto;">
<div class="cbox" style="left: 320px; top: 150px; width: 622px;">
<table>
<tr>
<td><img class="center" alt="" src="images/sponsor-dot.gif" width="15" /> <span onClick="openClose('a1')" style="cursor:hand; cursor:pointer; color: #33F; text-decoration:underline">Personnel Contacts</span>
<div id="a1" class="texter">
<ul class="style3">
<li class="listbox">Personnel Phone List</li>
<li class="listbox">Payroll Partners</li>
<li class="listbox">Personnel Specialist Work Assignments</li>
<li class="listbox">Work Area by Payroll Reporting Unit</li>
</ul>
</div>
</td>
</tr>
<tr>
<td><img class="center" alt="" src="images/sponsor-dot.gif" width="15" /> <span onClick="openClose('a2')" style="cursor:hand; cursor:pointer; color: #33F; text-decoration:underline">Insurance Information</span>
<div id="a2" class="texter">
<ul class="style3">
<li class="listbox"><a href='User_Area/HR/BenefitsWorksheet2017.pdf'>Benefits Worksheet </a></li>
<li class="listbox"><a href='http://eservices.calhr.ca.gov/BenefitsCalculatorExternal/'>Benefit Premium Calculator </a></li>
<li class="listbox"><a href='http://www.calhr.ca.gov/employees/pages/new-employee-benefits-orientation.aspx'>New Employee Benefits Orientation </a></li>
<li class="listbox"><a href='user_area/hr/HealthInsuranceMarketplaceCoverageOptions.pdf'>Health Insurance Marketplace Coverage Options </a></li>
<li class="listbox"><a href='user_area/hr/2018HighlightsAndChanges.pdf'>2018 Plan Highlights and Changes</a></li>
<li class="listbox"><a href='user_area/hr/DentalHandbook2017.pdf'>Dental Handbook 2017</a></li>
<li class="listbox"><a href='user_area/hr/DentalHandbook2018.pdf'>Dental Handbook 2018</a></li>
<li class="listbox"><a href='user_area/hr/CobenHandbook2017.pdf'>COBEN Handbook 2017</a></li>
<li class="listbox"><a href='user_area/hr/CobenHandbook2018.pdf'>COBEN Handbook 2018</a></li>
<li class="listbox"><a href='user_area/hr/FlexElectHandbook2017.pdf'>Flex Elect Handbook 2017</a></li>
<li class="listbox"><a href='user_area/hr/FlexElectHandbook2018.pdf'>Flex Elect Handbook 2018</a></li>
<li class="listbox"><a href='user_area/hr/Open_Enrollment_Event_Flyer.pdf'>2017-18 Open Enrollment Event 9/11/17 12pm-2pm</a></li>
<li class="listbox"><a href='user_area/hr/Open_Enrollment_Newsletter.pdf'>CalPERS 2017-18 Open Enrollment Newsletter</a></li>
</ul>
</div>
</td>
</tr>
<tr>
<td><img class="center" alt="" src="images/sponsor-dot.gif" width="15" /> <span onClick="openClose('a14')" style="cursor:hand; cursor:pointer; color: #33F; text-decoration:underline">Employment</span>
<div id="a14" class="texter">
<ul class="style3">
<li class="listbox">Training and Experience (T&E) Assessment Instructions</li>
<li class="listbox">Examination/Employment Application</li>
<li class="listbox">Exam Announcements</li>
<li class="listbox">Vacancy Listings</li>
<li class="listbox">CalHR Best Hiring Practices</li>
<li class="listbox">Authorization to Obtain Employment Reference Information</li>
<li class="listbox">Pre-Employment Reference Checklist</li>
</ul>
</div>
<p> </p>
</td>
</tr>
</table>
</div>
</div>
Related
I have an apps script that grabs a URL and returns it's contents. I want to then search the page for a specific string, before the javascript worked on the page. Then, I want to evaluate that same page after javascript has done it's thing.
The reason is that I have a 3rd-party script that replaces phone numbers on the page, based on region. I want to evaluate the original, before javascript source, to see if one of the replaceable numbers exists. If it does, I want check the after-javascript version to verify if it's been replaced with a number from that region.
I can do this manually by choosing "View Source" in the browser, then checking the Inspect Element where that string was found.
My problem is that I can't get the original source from UrlFetchApp. Is there a way to do that?
Thanks in advance,
Hans
--
Code
var doc = UrlFetchApp.fetch(url).getContentText();
// doc is the after-javascript version...
I just ran a test on an example website and found that UrlFetchApp does return the original source before JS rendering. I believe .fetch() works like a standard HTTP GET request, so I don't see why this wouldn't be the case.
Example: https://tutorialzine.com/2015/02/single-page-app-without-a-framework
UrlFetchApp Result Snippet:
<ul class="products-list">
<script id="products-template" type="x-handlebars-template">
{{#each this}}
<li data-index="{{id}}">
<img src="{{image.small}}" height="130" alt="{{name}}"/>
<h2> {{name}} </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>{{specs.manufacturer}}</li>
<li><span>Storage: </span>{{specs.storage}} GB</li>
<li><span>OS: </span>{{specs.os}}</li>
<li><span>Camera: </span>{{specs.camera}} Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">{{price}}$</p>
<div class="highlight"></div>
</li>
{{/each}}
</script>
</ul>
Post-JS Render Result:
<ul class="products-list">
<script id="products-template" type="x-handlebars-template">
{{#each this}}
<li data-index="{{id}}">
<img src="{{image.small}}" height="130" alt="{{name}}"/>
<h2> {{name}} </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>{{specs.manufacturer}}</li>
<li><span>Storage: </span>{{specs.storage}} GB</li>
<li><span>OS: </span>{{specs.os}}</li>
<li><span>Camera: </span>{{specs.camera}} Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">{{price}}$</p>
<div class="highlight"></div>
</li>
{{/each}}
</script>
<li data-index="1" class="">
<a href="#" class="product-photo"
><img
src="assets/images/sony-xperia-z3.jpg"
height="130"
alt="Sony Xperia Z3"
/></a>
<h2> Sony Xperia Z3 </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>Sony</li>
<li><span>Storage: </span>16 GB</li>
<li><span>OS: </span>Android</li>
<li><span>Camera: </span>15 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">899$</p>
<div class="highlight"></div>
</li>
<li data-index="2" class="">
<a href="#" class="product-photo"
><img src="assets/images/iphone6.jpg" height="130" alt="Iphone 6"
/></a>
<h2> Iphone 6 </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>Apple</li>
<li><span>Storage: </span>16 GB</li>
<li><span>OS: </span>iOS</li>
<li><span>Camera: </span>8 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">899$</p>
<div class="highlight"></div>
</li>
<li data-index="3" class="">
<a href="#" class="product-photo"
><img src="assets/images/htc-one.jpg" height="130" alt="HTC One M8"
/></a>
<h2> HTC One M8 </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>HTC</li>
<li><span>Storage: </span>32 GB</li>
<li><span>OS: </span>Android</li>
<li><span>Camera: </span>5 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">899$</p>
<div class="highlight"></div>
</li>
<li data-index="4" class="">
<a href="#" class="product-photo"
><img
src="assets/images/galaxy-alpha.jpg"
height="130"
alt="Galaxy Alpha"
/></a>
<h2> Galaxy Alpha </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>Samsung</li>
<li><span>Storage: </span>32 GB</li>
<li><span>OS: </span>Android</li>
<li><span>Camera: </span>12 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">899$</p>
<div class="highlight"></div>
</li>
<li data-index="5" class="">
<a href="#" class="product-photo"
><img
src="assets/images/nokia-lumia.jpg"
height="130"
alt="Nokia Lumia"
/></a>
<h2> Nokia Lumia </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>Nokia</li>
<li><span>Storage: </span>16 GB</li>
<li><span>OS: </span>Windows</li>
<li><span>Camera: </span>5 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">450$</p>
<div class="highlight"></div>
</li>
<li data-index="6" class="">
<a href="#" class="product-photo"
><img src="assets/images/zte-nubia.jpg" height="130" alt="Zte Nubia"
/></a>
<h2> Zte Nubia </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>ZTE</li>
<li><span>Storage: </span>32 GB</li>
<li><span>OS: </span>Android</li>
<li><span>Camera: </span>12 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">399$</p>
<div class="highlight"></div>
</li>
<li data-index="7" class="">
<a href="#" class="product-photo"
><img
src="assets/images/galaxy-s5.jpg"
height="130"
alt="Samsung Galaxy S5"
/></a>
<h2> Samsung Galaxy S5 </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>Samsung</li>
<li><span>Storage: </span>16 GB</li>
<li><span>OS: </span>Android</li>
<li><span>Camera: </span>15 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">399$</p>
<div class="highlight"></div>
</li>
<li data-index="8" class="">
<a href="#" class="product-photo"
><img src="assets/images/iphone5s.jpg" height="130" alt="Iphone 5S"
/></a>
<h2> Iphone 5S </h2>
<ul class="product-description">
<li><span>Manufacturer: </span>Apple</li>
<li><span>Storage: </span>16 GB</li>
<li><span>OS: </span>iOS</li>
<li><span>Camera: </span>8 Mpx</li>
</ul>
<button>Buy Now!</button>
<p class="product-price">399$</p>
<div class="highlight"></div>
</li>
</ul>
I am having trouble seting up the navigation of my app. For some reason the router outlet i have set keeps displaying the components even after clicking a routerlink to another component, it just show them on after the other and if i keep clicking de links the tables(thats what my components are) just are displayed one more time on the view.
That's my sidenav:
<ul id="sideNav" class="side-nav">
<li>
<div class="square " id="logoContainer">
<img src="../../assets/img/{{brand}}Logo.jpg" id="logo" class="backImg">
</div>
</li>
<li><a routerLink="/admRegiones">Inicio<i class="material-icons">home</i></a>
</li>
<ul class="collapsible collapsible-accordion">
<li>
<a class="collapsible-header">Regiones<i class="material-icons" style="padding-left: 15px">terrain</i></a>
<div class="collapsible-body">
<ul>
<li><a routerLink="/admRegiones" class="waves-effect waves-blue"><i class="material-icons right" style="padding-left: 10px">add_location</i> Administrar regiones </a></li>
</ul>
</div>
</li>
</ul>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li>
<a class="collapsible-header">Locaciones<i class="material-icons" style="padding-left: 15px">map</i></a>
<div class="collapsible-body">
<ul>
<li><a routerLink="/buscarLocacion" class="waves-effect waves-blue"><i class="material-icons right" style="padding-left: 10px">location_searching</i>Ir a locación </a></li>
<li><a routerLink="/admLocaciones" class="waves-effect waves-blue"><i class="material-icons right" style="padding-left: 10px">add_location</i> Administrar locaciones </a></li>
</ul>
</div>
</li>
</ul>
</li>
</ul>
This my routes:
RouterModule.forRoot([
{
path: 'admLocaciones',
component: AdmLocacionesComponent
},
{
path: 'buscarLocacion',
component: BuscarLocacionComponent
},
{
path: 'admRegiones',
component: AdmRegionesComponent
}
])
Here my component to display(both admRegiones and admLocaciones are practically the same):
<div class="container col s8"style="padding-top: 4%;">
Modal <table class="highlight striped center" id="tablaLocaciones" onload="loadTablaLocaciones()">
<hr>
<thead>
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Región</th>
<th>Editar</th>
<th>Eliminar</th>
</tr>
</thead>
<tbody id="locacionesBody">
</tbody>
</table>
</div>
and this my app-component template:
<app-header></app-header>
<div id="body">
<router-outlet></router-outlet>
</div>
<app-locacion></app-locacion>
<app-side-nav></app-side-nav>
I'm just developing a Reproting Tool and due to some reason i have two scroll bars,one which is for Chrome or any other browser and the other is part of the HTML,i couldn't trace anything back to the HTML..
> </head>
<body style="min-height:20px">
<!-- START PAGE CONTAINER -->
<div class="page-container" style="min-height:20px">
<!-- START PAGE SIDEBAR -->
<div class="page-sidebar">
<!-- START X-NAVIGATION -->
<ul class="x-navigation">
<li class="xn-logo">
Reports
</li>
<li class="xn-profile">
<!--<a href="#" class="profile-mini">
<img src="assets/images/users/avatar.jpg" alt="John Doe" />
</a>-->
<div class="profile">
<!--<div class="profile-image">
<img src="assets/images/users/avatar.jpg" alt="John Doe" />
</div>-->
<!--<div class="profile-data">
<div class="profile-data-name">John Doe</div>
<div class="profile-data-title">Web Developer/Designer</div>
</div>-->
<!--<div class="profile-controls">
<span class="fa fa-info"></span>
<span class="fa fa-envelope"></span>
</div>-->
</div>
</li>
<li class="xn-title">Navigation</li>
<li >
<span class="fa fa-cogs fa-spin" title="Configure Reports"></span> <span class="xn-text">Configure Reports</span>
</li>
<li>
<span class="fa fa-cogs fa-spin" title="Configure Dashboard"></span> <span class="xn-text">Configure Dashboard</span>
</li>
<li class="active">
<span class="fa fa-eye" title="View Dashboard"></span> <span class="xn-text">View Dashboard</span>
</li>
</ul>
<!-- END X-NAVIGATION -->
Any Help would be deeply appreciated
what you can do is
to the main div you can apply css like for example you have
<div class ="main">
// rest of your code
</div>
in your main style.css you can put
.main {
width:100%;
height:90%;
overflow:hidden;
}
if this doesn't work you can use
body {
overflow-y:hidden;
}
I have multilevel vertical menu,when i try to go to second level ,second level menu disappears.(some old versions of browsers it works fine )
and the height of second level menu is also not equal to first level.i want to something like that
I have pasted my exisiting code on
http://codepen.io/anon/pen/Mwwdqd
though code is not working on codepen,you can copy the html,css in separate files.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<html lang="en">
<body>
<div id="wrapper">
<div class="main-content">
<div class="topnav">
<div class="account">
<ul><li>Nathan Smith</li>
</ul>
</div>
<div class="accountname">
<ul><li>My Account</li></ul>
</div>
<div class="logout">
<ul><li>Log Out</li></ul>
</div>
<div class="addtofav"><ul><li>Add to Favourties</li></ul></span></div>
<div class="name"><ul><li>Voyager</li></ul></span></div>
<div>zxczxc czx</div>
</div>
</div>
<div class="sidebar">
<div class="left">
<div class="row col-xs-6 col-sm-3 col-md-2 logo">
<div class="imageinbottomtextontop">
<div class="titletextimage_image">
<a href="/content/count/en/default.html" target="_top">
<img title="COUNT" style="width:px; height:px;" src="images/logo.png" alt="COUNT">
</a>
</div>
</div>
</div>
</div>
<div class="box">
<div class="container-1">
<span class="icon"><i class="fa fa-search"></i></span>
<input type="search" id="search" placeholder="Search..." />
</div>
</div>
<div id="left-menu">
<div>
<ul class="nav nav-pills nav-stacked mn-vnavigation">
<li class="dropdown-submenu active">
<a tabindex="-1" href="#">Client Advice</a>
<ul class="dropdown-menu">
<li class="dropdown-submenu"><a tabindex="-1" href="#">Pre-advice</a></li>
<li class="dropdown-submenu">Strategy & Technical</li>
<li class="dropdown-submenu">Research</li>
<li class="dropdown-submenu active">
APL & Products
<ul class="dropdown-menu parent last-level">
<li style=" border-bottom: 1px solid #ccc;">
<a href="#">
Approved Product List
<span aria-hidden="true" class="glyphicon glyphicon-plus menu-align"></span>
<span aria-hidden="true" class="glyphicon glyphicon-minus menu-align" style="display:none;"></span>
</a>
<ul class="child">
<li style="padding:10px 15px;">Platforms</li>
<li style="padding: 10px 15px;">Managed Funds</li>
<li style="padding: 10px 15px;">Wealth Protection</li>
<li style="padding: 10px 15px;">Listed Securities</li>
<li style="padding: 10px 15px;">Wealth Protection</li>
<li style="padding: 10px 15px;">Listed Securities</li>
<li style="padding: 10px 15px;">Listed Securities</li>
</ul>
</li>
<li style=" border-bottom: 1px solid #ccc;">Model Portfolios</li>
<li style=" border-bottom: 1px solid #ccc;">Non-approved Products</li>
</ul>
</li>
<li class="dropdown-submenu">Implementation</li>
<li class="dropdown-submenu">Review</li>
<li class="dropdown-submenu">Execution Only</li>
</ul>
</li>
<li class="dropdown-submenu menu-align"><a href="#" >Personal Development</a></li>
<li class="dropdown-submenu menu-align "><a href="#" >Practice</a></li>
<li class="dropdown-submenu menu-align "><a href="#" >News</a></li>
</ul>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
$('.child').hide(); //Hide children by default
$('.parent').children().click(function () {
if (event.preventDefault) event.preventDefault()
else event.returnValue = false;
$(this).children('.child').slideToggle('slow');
$(this).find('span').toggle();
});
</script>
</body>
</html>
Remove margin-left: 25px; from .dropdown-submenu > .dropdown-menu
It disappears because when you try to hover into the second menu you run into that margin so you leave the initial element that maintains the hover state. Use padding instead.
Inspect the element with developer tools (right-click > Inspect) to better visually see the area around the element.
I have created web application where I want to highlight the menu selected.
Below is what I have
<div style="width: 80%;" align="left" >
<span style="display:inline-block;" align="left" >
<div id="menubar" class="grid-block">
<nav id="menu">
<ul class="menu menu-dropdown ">
<li class="level1 item101 active">
<a href="index.xhtml" class="level1">
<span>
<span class="icon" style="background-image: url('images/menu/icon_menu_home.png');background-repeat: no-repeat; background-position: top center">
</span>
Home
</span>
</a>
</li>
<li class="level1 item102 parent makeSpace default"
style="#{!PersonalInformationDataBean.pageViewData.contains('registerForPatentss') && !PersonalInformationDataBean.pageViewData.contains('success') && !PersonalInformationDataBean.pageViewData.contains('getReportss') && !PersonalInformationDataBean.pageViewData.contains('searhPatentss') ?'display:none':'display:inherit'};">
<a href="" class="level1 parent">
<span>
<span class="icon" style="background-image: url('images/menu/icon_menu_features.png');background-repeat: no-repeat; background-position: top center">
</span>Projects/Inventions
</span>
</a>
<div class="dropdown columns1">
<div class="dropdown-bg" style="overflow: hidden; width: 239px; height: 202px; ">
<div>
<div class="width100 column">
<ul class="level2">
<li class="level2 item200" style="width: 210px;#{PersonalInformationDataBean.pageViewData.contains('registerForPatentss')?'display:inherit':'display:none'}">
<a href="registerForPatentss.xhtml" class="level2">
<span>Register New Applicant
</span>
</a>
</li>
<li class="level2 item201" style="width: 210px;#{PersonalInformationDataBean.pageViewData.contains('success')?'display:inherit':'display:none'}">
<a href="success.xhtml" class="level2">
<span>Register New Project
</span>
</a>
</li>
<li class="level2 item202" style="width: 210px;#{PersonalInformationDataBean.pageViewData.contains('getReportss')?'display:inherit':'display:none'}">
<a href="getReportss.xhtml" class="level2">
<span>Project Reports
</span>
</a>
</li>
<li class="level2 item203" style="width: 210px;#{PersonalInformationDataBean.pageViewData.contains('searhPatentss')?'display:inherit':'display:none'}">
<a href="searhPatentss.xhtml" class="level2">
<span>Search For Project
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</li>
<li class="level1 item102 parent makeSpace default" style="#{!PersonalInformationDataBean.pageViewData.contains('systemLog') && !PersonalInformationDataBean.pageViewData.contains('addUser') && !PersonalInformationDataBean.pageViewData.contains('changePass') && !PersonalInformationDataBean.pageViewData.contains('userlistss')?'display:none':'display:inherit'}">
<a href="" class="level1 parent">
<span>
<span class="icon" style="background-image: url('images/menu/icon_menu_features.png');background-repeat: no-repeat; background-position: top center">
</span>Administrative
</span>
</a>
<div class="dropdown columns1">
<div class="dropdown-bg" style="overflow: hidden; width: 209px; height: 202px; ">
<div>
<div class="width100 column">
<ul class="level2">
<li class="level2 item200" style="width: 180px;#{PersonalInformationDataBean.pageViewData.contains('addUserss')?'display:inherit':'display:none'}">
<a href="addUserss.xhtml" class="level2">
<span>Add User Account
</span>
</a>
</li>
<li class="level2 item201" style="width: 180px;#{PersonalInformationDataBean.pageViewData.contains('logPatentSystemss')?'display:inherit':'display:none'}">
<a href="logPatentSystemss.xhtml" class="level2">
<span>System Log
</span>
</a>
</li>
<li class="level2 item202" style="width: 180px;#{PersonalInformationDataBean.pageViewData.contains('changePass')?'display:inherit':'display:none'}">
<a href="changePass.xhtml" class="level2">
<span>Change Password
</span>
</a>
</li>
<li class="level2 item203" style="width: 180px;#{PersonalInformationDataBean.pageViewData.contains('userlistss')?'display:inherit':'display:none'}">
<a href="userlistss.xhtml" class="level2">
<span>Details Of Registered Users
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</li>
</ul>
</nav>
</div>
</span>
</div>
This gives me output as below (its not same, but somewhat like this).
Home | Projects | Administrative
| |
| |
|- Men 1 |- Ad 1
|- Men 2 |- Ad 2
|- Men 3 |- Ad 3
Now what I want to do is
When Men 1 is selected, <li class="level1 item102 parent makeSpace default" should change to <li class="level1 item102 parent makeSpace active" i.e. take out default and take in active class.
When I click on Ad 2, <li class="level1 item102 parent makeSpace default" should change to <li class="level1 item102 parent makeSpace active"
Any idea how to get this done? I check online, however examples I get was for Level 0 menu.
See The demo
jQuery:
$("#menubar").on("click","li",function(e){
e.preventDefault();
e.stopPropagation();
if($(this).hasClass("active"))
{
$(this).removeClass("active").addClass("default");
}
else
{
$(this).addClass("active").removeClass("default");
}
});
What I did is is below....
var myURL = window.location.toString();
var endIndex = myURL.lastIndexOf(".", myURL);
var startIndex = myURL.lastIndexOf("/")+1;
var pageAccessed = myURL.substr(startIndex, endIndex-startIndex);
if (pageAccessed=="successLoginss") {
$(".homemenu").addClass("active");
$(".homemenu").removeClass("default");
}
<li class="level1 item101 default homemenu">
<a href="index.xhtml" class="level1">
<span>
<span class="icon" style="background-image: url('images/menu/icon_menu_home.png');background-repeat: no-repeat; background-position: top center">
</span>
Home
</span>
</a>
</li>
Dats it..... I know this is not right way, but I had to get done this way....