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....
Related
I am trying to avoid fixed height of bootstrap columns. I do have a Custom Mega Menu in my project where we show all our Nav bar entries. This one is a dynamically created code so it will be difficult to change the logic of the Mega menu creation so I am looking for some Css solution to fix this issue.
My code in high level look like.
<div class="row">
<div class="col-xl-3">... contents </div>
<div class="col-xl-3">... contents </div>
<div class="col-xl-3">... contents </div>
<div class="col-xl-3">... contents </div>
<div class="col-xl-3">... contents </div>
<div class="col-xl-3">... contents </div>
</div>
Since this one is a dynamic item we can expect n number of col-xl-3
The issue is I am getting some extra space in between columns. ( taking the max size item's size in each row)
As you can see in the image attached, The yellow color marked area I am trying to avoid.
I have tried to use d-block with float-left to the child elements.
Then I am getting display something like below.
Here also I am getting extra space in some places. Is there any way to get out of this issues?
What I am looking for is to move sections 5 to below 1 st section and 6 one to below 2 nd section etc .And remove the extra space between top and bottom columns
(the yellow highlighted space in the image)
I am adding a testing sample below here.
<html lang="en">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
type="text/css">
</head>
<div class="container-outer">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-12 navtop">
<nav class="navbar navbar-expand-lg navbar-light">
<div id="navbarContent" class="collapse navbar-collapse flex-md-column">
<ul class="navbar-nav mr-auto second-ul">
<ul class="navbar-nav treemenu">
<li class="nav-item dropdown position-static">
<a class="nav-link mnn-nav-link channelclass" href="#" id="navbarDropdown"
role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
MENU
<i class="fa fa-down"></i>
</a>
<div class="dropdown-menu w-100 ddn" aria-labelledby="navbarDropdown">
<div class="row d-block">
<div class="col-xl-3 float-left">
<p data-id="ACCT" class="submenu-title mnn-sdaaaent-nav-click">
1
<i class="sub-up-down fa-up fa"></i>
</p>
<ul class="list-unstyled ACCT ">
<li>
<a class="mnn-nav-sub-click" data-id="IPASSBOOKACCT">
seffwew
<i class="fa fa-down"></i>
</a>
<ul class="list-unstyled seffwewACCT mnn-nav-ul-sub" style="display: none;">
<li>
General Information
</li>
<li>
sefscsdsd Summary
</li>
<li>
Transaction
</li>
</ul>
</li>
<li>
sfdsfsds Income
</li>
</ul>
</div>
<div class="col-xl-3 float-left">
<p data-id="TAX" class="submenu-title mnn-sdaaaent-nav-click">
2
<i class="sub-up-down fa-up fa"></i>
</p>
<ul class="list-unstyled TAX ">
<li>
2019 sdfdsfsfsdfs Forms
<sup class="newtext">NEW</sup>
</li>
<li>
<a target="_blank" href="/Commonfiles/2019/2019POFManual.pdf">2019 POF Manual</a>
<sup class="newtext">NEW</sup>
</li>
<li>
Estimated Composite sdfdsfsfsdfses 4th Qtr Election
</li>
<li>
ds sfsdsdsd and Consent
</li>
<li>
NY IT-2658 Estimate
</li>
<li>
State sdfdsfsfsdfs Questionnaire
</li>
<li>
sdfdsfsfsdfs Presdaaaation Sign-Up
</li>
<li>
<a class="mnn-nav-sub-click" data-id="ARCHIVES">
Archives
<i class="fa fa-down"></i>
</a>
<ul class="list-unstyled ARCHIVES mnn-nav-ul-sub" style="display: none;">
<li>
2018 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/Commonfiles/2018/2018POFManual.pdf">2018 POF Manual</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2018/2018SampleForms965and965-A.PDF">2018 dfgdfgdg Manual addendum-Sample Forms 965 and 965-A</a>
</li>
<li>
Section 965 State by State Instructions
</li>
<li>
2017 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/Commonfiles/2017/Sec965FAQ.pdf">Section 965 FAQs</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2017/2017dfgdfgdgManual.pdf">2017 dfgdfgdg Manual</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2017/2017sdfdsfsfsdfs_Information.pdf">2017 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2017/2017dfgdfgdgManualAddendum965TransitionsdfdsfsfsdfsREVISED101218.pdf">2017 dfgdfgdg Manual Addendum 965 Transition sdfdsfsfsdfs revised 101218</a>
</li>
<li>
2016 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/Commonfiles/2016/2016_sdfdsfsfsdfsInformation.pdf">2016 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2016/2016dfgdfgdgManual.pdf">2016 dfgdfgdg Manual</a>
</li>
<li>
2015 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/Commonfiles/2015/2015sdfdsfsfsdfsInformation.pdf">2015 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2015/2015dfgdfgdgManual.pdf">2015 dfgdfgdg Manual</a>
</li>
<li>
2014 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/Commonfiles/2014/2014sdfdsfsfsdfsInformation.pdf">2014 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2014/2014dfgdfgdgManual.pdf">2014 dfgdfgdg Manual</a>
</li>
<li>
2013 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/CommonFiles/2013/2013sdfdsfsfsdfsInformation.pdf">2013 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2013/2013dfgdfgdgManual.pdf">2013 dfgdfgdg Manual</a>
</li>
<li>
2012 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/CommonFiles/2012/2012sdfdsfsfsdfsInformation.pdf">2012 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2012/2012dfgdfgdgManual.pdf">2012 dfgdfgdg Manual</a>
</li>
<li>
2011 sdfdsfsfsdfs Forms
</li>
<li>
<a target="_blank" href="/CommonFiles/2011/2011sdfdsfsfsdfsInformation.pdf">2011 sdfdsfsfsdfs Information</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/2011/2011dfgdfgdgManual.pdf">2011 dfgdfgdg Manual</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="col-xl-3 float-left">
<p data-id="FINPLANPTR" class="submenu-title mnn-sdaaaent-nav-click">
3
<i class="sub-up-down fa-up fa"></i>
</p>
<ul class="list-unstyled FINPLANPTR ">
<li>
dfgdfgdg-dfgdgdfgdfg Planning Services sfsdsdsd
</li>
</ul>
</div>
<div class="col-xl-3 float-left">
<p data-id="ADM" class="submenu-title mnn-sdaaaent-nav-click">
4
<i class="sub-up-down fa-up fa"></i>
</p>
<ul class="list-unstyled ADM ">
<li>
<a target="_blank" href="/Commonfiles/dfdfs/DirectAdmitBook.pdf">Direct dfdfs Manual</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/dfdfs/NewsdsdsdManual.pdf">New sdsdsd & Principal Manual</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/dfdfs/sdsdsdshipagreements.pdf">sdsdsdship Agreements</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/dfdfs/Americas_Operating_Agreement_as_amended_July_4_2015.pdf">Americas Operating Agreement</a>
</li>
</ul>
</div>
<div class="col-xl-3 float-left">
<p data-id="RET" class="submenu-title mnn-sdaaaent-nav-click">
5
<i class="sub-up-down fa-up fa"></i>
</p>
<ul class="list-unstyled RET ">
<li>
<a class="mnn-nav-sub-click" data-id="SPDS">
Summary Plan Descriptions (sdssdsd)
<i class="fa fa-down"></i>
</a>
<ul class="list-unstyled sdssdsd mnn-nav-ul-sub" style="display: none;">
<li>
<a target="_blank" href="/Commonfiles/sdsdaa/TYU sdsdsdship sdsdaa Plan - HR-10 Plan - 2016.pdf">TYU sdsdsdship sdsdaa Plan -HR10-Plan</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/sdsdaa/TYU sdsdaa Savings Plan -401(k) sdsdsd-principles - 2016.pdf">TYU sdsdaa Savings Plan-401(k)</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/sdsdaa/TYU PDBRP and IDBRP 2017.pdf">TYU PDBRP and IDBRP</a>
</li>
</ul>
</li>
<li>
<a href="/sdsdaa/401kContribution/_401kExclusionMsg">
401(k) asdaaa and
Election
</a>
</li>
<li>
<a class="mnn-nav-sub-click" data-id="sdssdsd">
Summary Plan Descriptions (sdssdsd)
<i class="fa fa-down"></i>
</a>
<ul class="list-unstyled sdssdsd mnn-nav-ul-sub" style="display: none;">
<li>
<a target="_blank" href="/Commonfiles/sdsdaa/TYU sdsdsdship sdsdaa Plan - HR-10 Plan - 2016.pdf">TYU sdsdsdship sdsdaa Plan -HR10-Plan</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/sdsdaa/TYU sdsdaa Savings Plan -401(k) sdsdsd-principles - 2016.pdf">TYU sdsdaa Savings Plan-401(k)</a>
</li>
<li>
<a target="_blank" href="/Commonfiles/sdsdaa/TYU PDBRP and IDBRP 2017.pdf">TYU asdadad and sdfsfsdsd</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="col-xl-3 float-left">
<a target="_blank" class="submenu-title mnn-sdaaaent-nav-click" href="https://sdaaa.TYU.net">6</a>
</div>
<div class="col-xl-3 float-left">
<a class="submenu-title mnn-sdaaaent-nav-click" href="https://ptrshpdashboard.TYU.net">7</a>
</div>
</div>
</div>
</li>
</ul>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script>
$(document).ready(function () {
$("#navbarContent").hide();
$('.navtrigger').click(function () {
$("#navbarContent").toggle();
$(this).toggleClass('active');
$("#mainListDiv").toggleClass("show_list");
$("#mainListDiv").fadeIn();
});
setTimeout(function () {
$('body').addClass('loaded');
}, 100);
});
$(".mnn-nav-ul-sub").hide();
$(".mnn-nav-sub-click").click(function () {
$(".mnn-nav-ul-sub").slideToggle();
$(this).find('i').toggleClass('fa fa-down fa fa-up');
$(".mnn-nav-sub-click").sdaaaent().removeClass('navactive');
});
$(".ddn").on("click", function (e) {
e.stopPropagation();
});
</script>
</body>
</html>
maybe this helps you CSS: remove empty Space between boxes
In your case
.wrapper {
column-count: 3;
column-gap: 1.25rem;
}
.part {
break-inside: avoid-column;
position: relative;
display: inline-block;
width: 100%;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
.row will be .wrapper and .col-xl-3 is .part, I recommend you not to use bootstrap classes for this
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>
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 am editing a Joomla template and I want to keep the menu and the header fixed when scrolling. The problem is when I set the position to fixed for both, the menu div moves up to the same position as the header div which is (0,0) and also the header div seems to have a different position than before as there is overlap between it and the slider underneath.
I am new to web development and I don't know why this is happening.
Screenshot 1 : Without setting the #yt_header and #yt_menuwrap to fixed positions.
Screenshot 2: #yt_menuwrap set to position fixed.
Screenshot 3: Both set to position fixed.
Screenshot 4 : #yt_menuwrap and #yt_header set to fixed with a z-index:-99999 for yt_header.Focus on the flag and the sky and compare them with the following screenshots.
#yt_menuwrap {
background: #D3D3D3;
margin: 0;
position: fixed;
z-index: 98;
width: 100%
}
#yt_header {
position: fixed;
z-index: 100;
padding: 0;
background-color: #f9fafc;
background-color: white;
width:100%;
left:0;
top:0;
}
<body id="bd" class="homepage home-layout1 res">
<div id="yt_wrapper" class="layout-wide">
<header id="yt_header" class="block">
<div class="container">
<div class="row">
<div id="search" class="col-md-12">
<form id="mod-finder-searchform" action="http://localhost:8888/home/index.php/en/2016-09-17-12-54-14" method="get" class="form-search">
<div class="finder">
<label for="mod-finder-searchword" class="element-invisible finder">Search</label>
<input type="text" name="q" id="mod-finder-searchword" class="search-query input-medium" size="25" value="" placeholder="Search ...">
</div>
</form>
</div>
<div id="yt_logo" class="col-md-5 hidden-sm hidden-xs">
<a class="logo" href="http://localhost:8888/home/" title="الجامعة التكنولوجيه">
<img data-placeholder="no" src="./UOT_files/uotlogo210new1.png" alt="الجامعة التكنولوجيه" style="width:61px;height:85px;">
</a>
</div>
<div id="title" class="col-md-2">
<!-- BEGIN: Custom advanced (www.pluginaria.com) -->
<div class="namePART1">
<p id="uniNamePART1">UNIVERSITY OF</p>
</div>
<div class="namePART2">
<p id="uniNamePART2">TECHNOLOGY</p>
</div>
<!-- END: Custom advanced (www.pluginaria.com) -->
</div>
<div id="icons-top" class="col-md-4">
<ul class="menu ">
<li class="item-1768"><a class="circle" href="http://localhost:8888/home/index.php/en/site-map">AR</a>
</li>
<li class="item-1770"><a class="circle fa-search" href="http://localhost:8888/home/index.php/en/2016-09-17-12-54-14"> </a>
</li>
<li class="item-1771"><a class="circle fa-graduation-cap" href="http://localhost:8888/home/index.php/en/2016-09-17-19-47-04"> </a>
</li>
</ul>
</div>
</div>
</div>
</header>
<nav id="yt_menuwrap" class="block">
<div class="container">
<div class="row">
<div id="test" class="col-sm-12 hidden-sm hidden-xs">
<ul class="menu ">
<li class="item-1763 active">STAFF
</li>
<li class="item-1764">FACULTY
</li>
<li class="item-1765">RESEARCH
</li>
<li class="item-1766">NEWS
</li>
<li class="item-1767">IMPORTANT SITES
</li>
</ul>
</div>
<div id="yt_mainmenu" class="col-md-12 co-sm-12 ">
<ul id="meganavigator" class="clearfix navi ">
<li class="active level1 first ">
<a title="HOME" class="active level1 first item-link" href="http://localhost:8888/home/"><span class="menu-title">HOME</span></a>
</li>
<li class="level1 havechild ">
<a title="UNIVERSITY" class="level1 havechild item-link" href="http://localhost:8888/home/en#"><span class="menu-title">UNIVERSITY</span></a>
<!-- open mega-content div -->
<div class="level2 menu mega-content" style="display: none;">
<div class="mega-content-inner clearfix">
<div class="mega-col first one">
<ul class="subnavi level2">
<li class="level2 first havechild ">
<a title="About University" class="level2 first havechild item-link" href="http://localhost:8888/home/en#"><span class="menu-title">About University</span></a>
<!-- open mega-content div -->
<div class="level3 menu mega-content" style="display: none;">
<div class="mega-content-inner clearfix">
<div class="mega-col first one">
<ul class="subnavi level3">
<li class="level3 first ">
<a title="Mission and objectives of the university" class="level3 first item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/mission-and-objectives-of-the-university"><span class="menu-title">Mission and objectives of the university</span></a>
</li>
<li class="level3 ">
<a title="Members of the University Council" class="level3 item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/members-of-the-university-council"><span class="menu-title">Members of the University Council</span></a>
</li>
<li class="level3 ">
<a title="Organizational Chart" class="level3 item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/organizational-chart"><span class="menu-title">Organizational Chart</span></a>
</li>
<li class="level3 ">
<a title="Laws and regulations" class="level3 item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/laws-and-regulations"><span class="menu-title">Laws and regulations</span></a>
</li>
<li class="level3 ">
<a title="Category university" class="level3 item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/category-university"><span class="menu-title">Category university</span></a>
</li>
<li class="level3 ">
<a title="History of the university" class="level3 item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/history-of-the-university"><span class="menu-title">History of the university</span></a>
</li>
<li class="level3 ">
<a title="University landmarks" class="level3 item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/university-landmarks"><span class="menu-title">University landmarks</span></a>
</li>
<li class="level3 last ">
<a title="University logo" class="level3 last item-link" href="http://localhost:8888/home/index.php/en/2016-05-29-06-57-22/2016-05-29-08-15-31/university-logo"><span class="menu-title">University logo</span></a>
</li>
</ul>
</div>
</div>
</div>
</li>
Try this code:
#yt_menuwrap {
background: #D3D3D3;
margin: 0;
position: fixed;
z-index: 999;
width: 100%;
top: 0px;
}
<script>
jQuery(document).ready(function(){
jQuery(window).scroll(function(){
if (jQuery(window).scrollTop() >= 300) {
jQuery('#yt_wrapper').addClass('fixed-header');
}
else {
jQuery('#yt_wrapper').removeClass('fixed-header');
}
});
});
</script>
<style>
.fixed-header { position: fixed; top:0; left:0; right: 0; width: 100%; background-color: #fff; z-index: 1010; margin: 0;
}
</style>
<div class="content">
<ul class="clean menu" id="topics">
<li class="drop png">
<div>
<span href="#" id="phone" style="BACKGROUND-POSITION: 13px -79px">Phone</span>
</div>
<ul class="clean menu sub">
<li>
<a cat="tech" class="sec_phone_0" href="javascript:void(0);" name="&lid=choose_category_phone_digital" rel="1">FiOS Digital Voice</a>
</li>
<li class="last">
<a cat="tech" class="sec_phone_1" href="javascript:void(0);" name="&lid=choose_category_phone_dialup" rel="1">Home Phone(Copper)</a>
</li>
<li class="last">
<a cat="tech" class="sec_phone_2" href="javascript:void(0);" name="&lid=choose_category_phone_fiosVoice" rel="1">FiOS Voice</a>
</li>
<li class="last" style="margin-bottom:7px;">
<a cat="tech" class="sec_phone_2" href="javascript:void();" name="&lid=choose_category_phone_wireless" rel="1">Verizon Wireless</a>
</li>
</ul>
</li>
</ul>
</div>
Now I need to select the "cat" value of Fios Voice. How can I do this in Mootools v1.3.2?
Need to set the value in cookie.
This script gets the property of link on click event.
window.addEvent('domready',function(){
$$('ul.sub')[0].getElements('a').each(function(el,ind){
el.addEvent('click',function(){
var cat = el.getProperty('cat');
alert(cat)
})
})
})
For case when <a cat="tech1" class="sec_phone_0 active" href="javascript:void(0);" name="&lid=choose_category_phone_digital" rel="1">FiOS Digital Voice</a> has class="active"
window.addEvent('domready',function(){
if($$('ul.sub')[0].getElements('a.active')[0]){
var cat = $$('ul.sub')[0].getElement('a.active').getProperty('cat');
alert(cat);
}
})