SITE CODE INJECTIONS
HEADER
<style>
/* JEN STUDIO THEME ONLY */
#wrapper {
max-width: 1200px !important;
margin: 0 auto;
}
.postContent.doubleColumn center {
margin-bottom: 20px;
background: #44591b82;
border-radius: 5px;
}
.header-logo {
width: 305px;
height: 108px;
margin: 0 auto -40px;
padding: 0;
position: relative;
z-index: 1;
}
#postMain {
padding-top: 40px;
}
.pag {
display: none !important;
}
.featuredContainer {
height: auto;
}
.featuredContainer {
height: 66%;
min-height: 350px;
max-height: 350px;
}
.featuredContainer.show {
border-radius: 0 5px 0 0;
}
.featuredContainer .contentWrap {
width: auto;
}
.featuredContainer .contentWrap .dateStamp,
.featuredContainer .contentWrap p,
.featuredContainer .contentWrap footer,
.featuredContainer .pagination,
.tagShare,
#newsFeed .noResults .dot,
#newsFeed .previewContainer .dot,
#controls,
.logoContain .copy,
#newsFeed .noResults .dateStamp,
#newsFeed .previewContainer .dateStamp,
#newsFeed,
#postMain .postContent .tags,
figcaption,
.wookmarkWrap #wookmark .item .postTitle {
display:none;
}
nav #mainNav li ul li a {
padding-left: 35px !important;
}
#newsFeed .previewContainer:hover {
background: #000 !important;
}
#newsFeed .previewContainer:first-of-type .content {
border: none !important;
}
nav .logoContain {
background: #000 !important;
}
nav .logoContain .logo img {
width: 260px !important;
padding: 10px 0 10px 0 !important;
}
#newsFeed #filters {
border-bottom: none !important;
color: #459fe2;
font-family: yanone kaffeesatz,sans-serif;
font-size: 20px;
background: transparent;
}
#newsFeed .noResults::after,
#newsFeed .previewContainer:last-of-type::after,
#newsFeed .previewContainer:not(.active)::before {
background: #4e5962;
}
#newsFeed .noResults .content,
#newsFeed .previewContainer .content,
#newsFeed .previewContainer:first-of-type .content {
border-left: solid 1px #0c3040 !important;
}
#newsFeed #tags ul {
background: transparent !important;
}
#newsFeed #feed {
background: #15232b !important;
}
#newsFeed .noResults h1,
#newsFeed .previewContainer h1 {
color: #fff !important;
font-weight: normal !important;
}
.dateStamp,
.postTitle,
h1, h2, h3, h4, h5 {
color: #fff !important;
}
div#speechkit-player {
width: 82% !important;
margin: 0 auto 1em !important
}
.article-excerpt {
margin: 0 0 1rem;
font-size: 1rem;
line-height: 1.2em;
opacity: .6;
}
.kg-bookmark-description {
font-size: unset;
}
#discourse-comments,
.kg-audio-thumbnail,
.kg-audio-title {
display: none;
}
.kg-audio-card {
min-height: 40px;
}
.kg-file-card a.kg-file-card-container {
display: flex !important;
min-height: unset;
}
.kg-file-card {
display: flex !important;
padding-bottom: 20px !important;
margin-top: -20px !important;
}
.kg-file-card-title {
display: none;
}
body, #wrapper, #mainContainer, #container, .wookmarkWrap, nav, #mainNav {
background: #000 url(https://fisherconsultinggroup.com/content/images/2023/03/back-1.gif) repeat-x !important;
color: #a9a9a9;
}
/*
.wookmarkWrap {
background: #a0a7b6 !important;
background: #7d8491 !important;
}
*/
.gh-portal-triggerbtn-container .with-label {
background: #4e0050bf !important;
height: 50px !important;
}
html,
body,
#container {
height: 100%;
}
.wookmarkWrap {
height: 100%;
overflow: visible;
border-radius: 0 0 5px 5px;
}
#mainContainer {
height: 100% !important;
overflow-x: hidden !important;
}
#newsFeed {
background: transparent;
}
#newsFeed #feed {
background: #e2e5eb
}
#newsFeed .noResults h1, #newsFeed .previewContainer h1 {
color: #ffffff;
}
#newsFeed .noResults h1, #newsFeed .previewContainer h1 {
color: #4e0050;
font-weight: 800;
}
#newsFeed .noResults .dateStamp, #newsFeed .previewContainer .dateStamp {
color: #000000;
}
nav #mainNav .menu {
background: #0c3040;
position: fixed;
top: 68px;
z-index: 999999;
}
nav #mainNav li .title {
font-size: 18px;
font-family: yanone kaffeesatz,sans-serif;
}
.wookmarkWrap #wookmark .item {
border-radius: 5px;
box-shadow: -1px 3px 15px -4px #624c4c;
}
.wookmarkWrap #wookmark .item {
background: #000 !important;
}
.wookmarkWrap #wookmark .item,
.wookmarkWrap #wookmark .item:hover {
border-top: 1px solid rgba(255, 255, 255, 0.5);
border-left: 1px solid rgba(255, 255, 255, 0.5);
backdrop-filter: blur(5px);
cursor: pointer;
box-shadow: 20px 20px 50px rgb(0 0 0 / 50%);
border-radius: 15px;
background: rgba(255, 255, 255, 0.1) !important;
width: 258px !important;
height: 240px !important;
}
.wookmarkWrap #wookmark .item .postTitle a {
color: #fff !important;
text-decoration: none;
}
audio {
box-shadow: -1px 3px 15px -4px #624c4c;
}
.wookmarkWrap #wookmark .item .content {
margin: 20px 20px 0;
}
.wookmarkWrap #wookmark .item .dateStamp,
.wookmarkWrap #wookmark .item footer {
display: none;
}
.wookmarkWrap #wookmark .item .content {
text-align: center;
margin: 30px;
}
@media only screen and (max-width: 490px) {
.wookmarkWrap #wookmark .item {
position: absolute;
}
}
.tagShare .share {
position: relative;
margin: 0;
left: -100px !important;
}
.tagShare .shareIcon {
background: #6fa3c096;
border-radius: 0 50% 50% 0;
}
.shareIcon:hover~.share, .share:hover {
position: relative;
right: 20px;
padding-left: 120px;
display:block;
}
#postMain .postContent a.icon-twitter:hover,
#postMain .postContent a.icon-facebook:hover {
margin: 0;
padding: 5px;
border: 1px solid #6fa3c0;
}
.tagShare {
color: #000;
width: 100%;
height: auto;
top: 0;
left: 0;
line-height: 15px;
}
#wookmark .tagShare {
position: relative;
}
#wookmark .shareIcon,
#wookmark .share {
display:none;
}
.tagShare .tags {
background: transparent;
padding: 0 10px 10px;
font-family: yanone kaffeesatz,sans-serif;
width: -webkit-fill-available;
width: -moz-available;
}
.tags a,
#postMain .postContent .tags a {
letter-spacing: .030em;
font-family: 'Yanone Kaffeesatz', sans-serif;
display: inline-block;
}
.tagShare a {
color: #6fa3c0;
padding: 3px 5px 1px;
}
nav .logoContain .logo img {
-moz-box-shadow: -1px 3px 15px -4px #624c4c;
-webkit-box-shadow: -1px 3px 15px -4px #624c4c;
box-shadow: -1px 3px 15px -4px #624c4c;
}
#postMain img {
border-radius: 5px;
-moz-box-shadow: -1px 3px 15px -4px #624c4c;
-webkit-box-shadow: -1px 3px 15px -4px #624c4c;
box-shadow: -1px 3px 15px -4px #624c4c;
}
#postMain .postContent {
text-align: left;
}
p #postMain .postContent a {
}
#postMain .postContent a,
a.kg-bookmark-container {
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
letter-spacing: .030em;
font-family: 'Yanone Kaffeesatz', sans-serif;
color: #3495db;
border-radius: 4px;
box-shadow: 0px 2px 7px -3px #624c4c;
display: inline-block !important;
padding: 8px 9px 3px 10px !important;
background: #0003;
}
#postMain .postContent a:hover,
#postMain .postContent a:active,
.kg-bookmark-card a:hover,
.kg-embed-card a:active,
a.kg-bookmark-container a:hover,
a.kg-bookmark-container a:active {
color: #009a49;
background: transparent !important;
}
#newsFeed #tags ul a,
#newsFeed #tags ul a:hover,
#newsFeed #tags ul a:active,
#newsFeed #filters input[type=radio]+label,
#postMain .postContent a,
#postMain .postContent a:hover,
#postMain .postContent a:active {
filter: drop-shadow(1px 4px 2px rgba(0,0,0,0.2));
}
#newsFeed #tags ul a:hover,
#newsFeed #tags ul a:active,
#postMain .postContent a:hover,
#postMain .postContent a:active {
background: transparent;
color: #009a49 !important;
}
#postMain .postContent {
min-height: 500px;
text-align: left;
}
#postMain .tagShare {
margin: 0;
}
#postMain .postContent .tags {
margin-bottom:20px
}
#postMain .postContent .tags,
figcaption {
text-align: center;
padding: 0;
font-family: yanone kaffeesatz,sans-serif;
}
#postMain .postContent h1.postTitle {
margin-bottom: 5px !important;
}
#postMain .postContent .dateStamp,
.dateStamp a {
margin: 0 0 7px !important;
display: none;
}
#postMain .postContent hr {
background: #ebebeb30;
height: 3px;
margin-top: 25px;
margin-bottom: 25px;
}
#postMain .postContent ol,
#postMain .postContent ul {
border-left: solid 10px #ebebeb30;
}
.kg-image-card { float: right }
.kg-bookmark-card,
.kg-embed-card
.kg-card {
box-shadow: -1px 3px 15px -4px #624c4c;
background: #fff;
}
#newsFeed #filters {
border-bottom: 4px solid #e0e0e0;
color: #459fe2;
font-family: yanone kaffeesatz,sans-serif;
font-size: 20px;
}
#newsFeed #filters #navUnderline {
margin-top: -20.5px;
line-height: 7px;
height: 7px;
}
#newsFeed #filters input[type=radio]:nth-of-type(3):checked+label~#navUnderline #highlight {
margin-left: 65%;
width: 35%;
}
#newsFeed #filters input[type=radio]:nth-of-type(2):checked+label~#navUnderline #highlight {
margin-left: 23%;
width: 35%;
}
#newsFeed #filters input[type=radio]:nth-of-type(1):checked+label~#navUnderline #highlight {
margin-left: -5px;
width: 20%;
}
#newsFeed #tags ul {
font-size: 18px;
letter-spacing: 1px;
box-shadow: 0px 2px 7px -3px #624c4c;
background: #fff
}
#newsFeed .noResults .dateStamp,
#newsFeed .noResults h1,
#newsFeed .noResults p,
#newsFeed .previewContainer .dateStamp,
#newsFeed .previewContainer h1,
#newsFeed .previewContainer p {
padding-left: 10px;
}
#newsFeed .noResults .content,
#newsFeed .previewContainer .content {
padding: 10px 0;
}
#newsFeed .noResults h1, #newsFeed .previewContainer h1 {
margin-top: 5px;
line-height: 17.5px;
font-size: 13px;
}
.cursor {
position: relative;
}
.cursor i {
position: absolute;
width: 3px;
height: 20px;
background-color: #ef6752;
left: 5px;
top: 5px;
animation-name: blink;
animation-duration: 1000ms;
animation-iteration-count: infinite;
opacity: 1;
}
.cursor input:focus + i {
display: none;
}
@keyframes blink {
from { opacity: 1; }
to { opacity: 0; }
}
#newsFeed #search input[type=text] {
color: #404e56;
padding: 7px 0 5px 5px;
font-size: 13px;
font-family: "PT Sans","Myriad Pro",sans-serif;
}
#newsFeed #search input~label {
display: none;
}
@media only screen and (max-width: 680px) {
#postMain {
padding-top: 60px;
}
#postMain .postContent {
margin-top: 0;
}
}
@media only screen and (min-width: 681px) {
#postMain .showHeroImage {
margin: 7px 0 0 10px;
width: 50%;
float:right;
height:auto;
}
}
@media only screen and (min-width: 681px) {
#postMain .postContent.doubleColumn .showHeroImage {
margin: 0 0 20px 0;
width: 100%;
float:left;
height:auto;
}
}
@media only screen and (min-width: 1300px) {
#postMain .postContent.doubleColumn {
margin: 20px 6% 20px !important;
width: auto !important;
}
}
.author-template #postMain div.heroImage.showHeroImage {
background-repeat: no-repeat;
background-size: contain;
width: 100%;
height: 200px;
margin: 0 auto;
}
#postMain section.postContent.authorColumn {
text-align:center;
}
.featuredContainer #controls .left,
.featuredContainer #controls .right {
background: #00000020
}
nav .logoContain,
.featuredContainer #controls .left:hover,
.featuredContainer #controls .right:hover,
.featuredContainer .readMore:hover {
background: #4e0050
}
nav .logoContain,
nav .logoContain .logo,
nav .logoContain .copy {
height: 68px;
line-height: 68px;
margin: 0;
}
nav .logoContain .logo img {
width: 60px;
padding: 4px 5px 4px 3px;
}
nav .logoContain .copy img {
padding: 10px;
height: 50px;
width: auto;
opacity: .9;
}
nav #mainNav {
margin-bottom: 68px;
top: 68px;
bottom: -68px;
color: #cfd2d8;
background: #15232b;
}
#postMain .postContent .jqcloud-word a {
box-shadow: none;
color: unset;
background: unset;
}
#postMain .postContent .jqcloud-word a:hover,
#postMain .postContent .jqcloud-word a:active {
color: unset;
background: unset;
}
.tagCloud {
margin: 0 auto;
width: auto;
height: 250px;
margin-left: 0;
margin-right: 0;
background-color: #fff;
border-width: 1px;
border-color: #e11e1e;
border-radius: 4px 4px 0 0;
box-shadow: 0px 2px 7px -3px #624c4c;
}
/* END JEN STUDIO THEME ONLY */
</style>
<style>
/*
.soundcite-loading:before {
border: 2px solid #fff !important;
}
.light-mode .soundcite-loading:before {
border: 2px solid #000 !important;
}
.soundcite-loaded {
background-color: #ffffff26 !important;
}
.light-mode .soundcite-loaded {
background-color: rgba(0,0,0,.15) !important;
}
.soundcite-play:before {
border-left: 0.75em solid white !important;
}
.light-mode .soundcite-play:before {
border-left: 0.75em solid black !important;
}
.soundcite-pause:before {
border-left: .75em double white !important;
}
.light-mode .soundcite-pause:before {
border-left: .75em double black !important;
}
*/
.soundcite-loaded {
line-height: 1.3em !important;
background-color: #ffffff26 !important;
}
.light-mode .soundcite-loaded {
line-height: 1.3em !important;
background-color: #0000000d !important;
}
.soundcite-loaded:before {
vertical-align: -10% !important;
margin-right: -2px !important;
}
.soundcite-play:before {
font-size: 0.8em !important;
top: -.07em !important;
border: 0.5em solid transparent !important;
border-left: 0.7em solid green !important;
}
.soundcite-pause:before {
font-size: 0.8em !important;
position: relative !important;
top: -.07em !important;
height: 1em !important;
border-right: .5em solid transparent !important;
border-left: .7em double red !important;
}
</style>
<style>
.sp-wrapper {z-index:999999999999}
.sp-wrapper .content {padding: 1em}
.sp-wrapper .sp-close-button::before {
content: 'X';
color: red;
opacity: 50%;
font-size: 42px;
font-weight: 800;
top: 60%;
left: 35%;
z-index: 9;
}
</style>
<style>
/* DOCSLAB THEME ONLY */
/*
body {
background-color: #000 !important;
background: url(https://fisher.1namespace.com/content/images/2023/03/back-1.gif) repeat-x;
}
.menu-wrapper {
flex-direction: column;
text-align: center;
margin: 0 auto;
}
@media screen and (max-width: 1080px) and (min-width: 992px) {
.center-menu {
margin: 0;
}
}
@media screen and (max-width: 991px) {
#nav {
position: absolute;
top: 100%;
background-color: #000;
}
}
@media screen and (max-width: 575px) {
.mobile-menu-bar {
margin: 0;
}
}
.post-content, .post-content-footer {
background: #26262c;
padding: 20px;
border-radius: 5px;
}
.header-area,
.hero-section,
.promo-section,
.footer-section,
.copy-right-section,
.bg-promo-section .promo-section {
background:transparent;
}
.logo {
max-width: 250px;
text-align: center;
margin: 0 auto;
}
.post-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.single-tag-box {
padding: 0;
height: 100%;
transition: background-color .3s ease-in-out;
}
.hero-section,
.promo-section,
.sidebar-docs,
.promo-icon,
.breadcrumbs-section,
.tag-details,
.footer-section {
display: none !important;
}
@media (min-width: 992px) {
.col-lg-4 {
-ms-flex: 0 0 25%;
flex: 0 0 25%;
max-width: 25%;
}
}
*/
</style>
<style>
/* UNIVERSAL TO ALL THEMES */
.post-author-meta,
.post-card-meta,
.post-content-footer {
display: none !important;
}
div.gh-content.gh-canvas p img {
margin: 0 auto;
}
</style>
<style>
/* mega menu */
li.menu-item-has-children {
position: relative;
padding-right: 20px!important;
display: inline-block;
}
.center-menu ul li a,
li.menu-item-has-children a {
font-family: Tahoma !important;
font-size: 14px !important;
font-weight: 400 !important;
letter-spacing: 0.1em;
text-transform: uppercase !important;
line-height: 20px;
}
.menu-item-has-children svg {
position: absolute;
right: -6px;
top: 56%;
transform: translate(-0%, -50%) scale(1);
display: none;
}
ul.ghost-submenu {
background: #fff;
color: #000;
padding: 0;
border-radius: 5px;
width: 180px;
max-width: 180px;
position: absolute;
visibility: hidden;
z-index: 1;
opacity: 0;
top: 24px;
transition: 0.3s;
box-shadow: 0 1px 5px 0 rgb(0 0 0 / 14%);
/* left: 0; */
}
li.menu-item-has-children:hover ul.ghost-submenu {
visibility: visible!important;
opacity: 1!important;
top: 24px!important;
}
ul.ghost-submenu li {
list-style: none;
padding: 0;
}
/*
ul li {
opacity: 0;
}
*/
li.nav-item.menu-item-has-children.menu-item-has-megamenu ul.ghost-submenu {
width: 100vh;
}
</style>
<style>
/*
.center-menu ul li a {
font-size: 14px;
line-height: 20px;
}
*/
a.nav-about-fcg-has_child {
border-bottom:4px solid #337e8b !important;
}
ul.ghost-submenu a.nav-our-clients-subitem,
ul.ghost-submenu a.nav-client-testimonials-subitem,
ul.ghost-submenu a.nav-contact-us-subitem {
background: #337e8b;
color: #fff;
min-width: 180px;
text-align: left;
padding: 0 10px;
font-size: 10px !important;
font-weight: 400 !important;
}
a.nav-our-expertise-has_child {
border-bottom:4px solid #ff9000 !important;
}
ul.ghost-submenu a.nav-assessments-subitem,
ul.ghost-submenu a.nav-services-products-subitem,
ul.ghost-submenu a.nav-how-we-work-subitem,
ul.ghost-submenu a.nav-quotes-subitem {
background: #ff9000;
color: #fff;
min-width: 180px;
text-align: left;
padding: 0 10px;
font-size: 10px !important;
font-weight: 400 !important;
}
a.nav-corporate-culture-has_child {
border-bottom:4px solid #8bc800 !important;
}
ul.ghost-submenu a.nav-like-it-or-not-culture-matters-subitem,
ul.ghost-submenu a.nav-the-denison-culture-model-subitem,
ul.ghost-submenu a.nav-linking-culture-with-performance-subitem,
ul.ghost-submenu a.nav-self-assessments-subitem {
background: #8bc800;
color: #fff;
min-width: 180px;
text-align: left;
padding: 0 10px;
font-size: 10px !important;
font-weight: 400 !important;
}
a.nav-articles-publications-has_child {
border-bottom:4px solid #c6007d !important;
}
ul.ghost-submenu a.nav-conference-presentations-subitem,
ul.ghost-submenu a.nav-conference-organizers-subitem {
background: #c6007d;
color: #fff;
min-width: 180px;
text-align: left;
padding: 0 10px;
font-size: 10px !important;
font-weight: 400 !important;
}
</style>
FOOTER
<script>
(function ($) {
"use strict";
function multiLevel(targetElement = "ul li", mLhasSubmenu = "mL-has-submenu", mLsubmenu = "mL-submenu") {
let mLparentDetecttext = "[-]";
let mLchildDetectText = "[--]";
let mLdomArrayElement = [];
let mLparentIndex = [];
let mLparentLen = 0;
// Find Dropdown parent element
$(`${targetElement} li`).each(function (index, element) {
if ($(this).text().includes(mLparentDetecttext)) {
mLparentIndex.push(index); // Make dropdown parent array index
mLparentLen++;
$(this).push(element);
if (!$(this).hasClass('menu-item-has-children')) {
$(this).addClass(mLhasSubmenu); // Add claas in dropdown element
}
$(this).append(`<ul class="${mLsubmenu}"></ul>`); // Append submenu element
}
});
let elIndex;
// Code last multilevel
let lastMlElementText = $(`.${mLhasSubmenu}`).last().text();
// console.log(lastMlElement);
// Using loop to reach dropdown parent element
for (let i = 0; i < mLparentLen; i++) {
elIndex = 0 // Initial elemet value
// Find subitem element
$(`${targetElement} li`).each(function (index, element) {
let mLsubitem = $(this).text().includes(mLchildDetectText); // Find subitem element
if (mLsubitem) {
if (elIndex + 1 >= mLparentIndex[i + 1] + 1) { // Each loop will be break
return false; //Stoped each loop
}
if (elIndex <= mLparentIndex[i + 1] || elIndex >= mLparentIndex[mLparentIndex.length - 1]) {
if (!mLparentIndex.includes(index)) { //Check if not index already insert
mLdomArrayElement.push(element); // Incert subitem element in dom array
mLparentIndex.push(index); // incert subitem index in indexPush array
}
}
}
elIndex++; // increase element index value
});
$(`.${mLhasSubmenu} ul.${mLsubmenu}:eq(${i})`).append(mLdomArrayElement); // Append related subitem dom element into submenu
mLdomArrayElement = []; // Make dom array element empty.
}
let lastMlElementIndex = 0; // Find subitem element
let lastChildIndex = 0, lastChildElementText;
$(`${targetElement} li`).each(function (index, element) {
let lastMlElement = $(this).text().includes(lastMlElementText); // Find subitem element
if (lastMlElement) {
if (!$(this).hasClass('mLlastPrentElement')) {
$(this).addClass('mLlastPrentElement');
lastChildElementText = $(this).parent().children('li').last().text();
lastMlElementIndex = index;
}
}
if ($(this).text().includes(lastChildElementText)) {
lastChildIndex = index;
}
if (lastMlElementIndex < index && lastMlElementIndex > 0) {
$(this).addClass('mLlastChildElements');
$(".mLlastPrentElement ul").append($(`.mLlastChildElements`));
if (lastChildIndex == index) {
return false;
}
}
});
remove_text(mLhasSubmenu, mLparentDetecttext);
remove_text('subitem', mLchildDetectText);
}
function remove_text(textClass, replacedText) {
const mLhasSubmenuEL = $(`.${textClass}`);
mLhasSubmenuEL.each(function () {
if ($(this).find("> a:first").text().includes(replacedText)) {
let textFull = $(this).find("> a:first").text(); // Find has child inner text
$(this).find("> a:first").text(textFull.replaceAll(replacedText, ""));
}
});
}
function megamenu(hasMegaMenuClasses = "menu-item-has-megamenu", col = 3, item_slice = 4, hasMegaMenuDetectText = "[has_megamenu]", submenuUlClasses = "ghost-submenu") {
let megaMenuEl = $(`.${hasMegaMenuClasses} li`);
$(`.${hasMegaMenuClasses} .${submenuUlClasses}`).addClass('row');
let titleText = [];
let titleIndex = 0;
megaMenuEl.each(function (index, element) {
if ($(this).text().includes("[title]")) {
titleIndex++;
$(this).addClass("megamenu-title");
titleText.push($(this).text())
$(".megamenu-title").empty();
}
});
for (let i = 0; i < megaMenuEl.length; i += item_slice) {
megaMenuEl.slice(i, i + item_slice).wrapAll(`<div class='col-md-${col}'></div>`);
// console.log(titleText[i]);
// console.log(titleText);
}
for (let i = 0; i < titleText.length; i++) {
$(`.${submenuUlClasses} > div:eq(${i})`).prepend(`<h6 class="megamenu-title-text text-danger">${titleText[i]}</h6>`);
$(".megamenu-title-text").text(titleText[i].replaceAll("[title]", ""));
}
remove_text(hasMegaMenuClasses, hasMegaMenuDetectText);
}
function ghost_dropdown(options) {
// Default options
let defultOptions = {
targetElement: "nav.ul li",
hasChildrenClasses: "menu-item-has-children",
hasChildDetectText: "[has_child]",
hasChildrenIcon: "<svg width='19' height='10' viewBox='0 0 19 10' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M1.74805 1.52002L9.54883 9.00002L17.3496 1.52002' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>",
hasMegaMenuDetectText: "[has_megamenu]",
hasMegaMenuClasses: "menu-item-has-megamenu",
submenuUlClasses: "ghost-submenu",
subitemDetectText: "[subitem]",
subitemLiClasses: "subitem"
}
//Marge defaultOptions
options = {
...defultOptions,
...options
}
// Target Element
let targetElement = options.targetElement;
//Default value
let hasChildrenClasses = options.hasChildrenClasses;
let hasChildDetectText = options.hasChildDetectText;
let hasMegaMenuClasses = options.hasMegaMenuClasses;
let hasMegaMenuDetectText = options.hasMegaMenuDetectText;
let hasChildrenIcon = options.hasChildrenIcon;
let submenuUlClasses = options.submenuUlClasses;
let subitemDetectText = options.subitemDetectText;
let subitemLiClasses = options.subitemLiClasses;
// Declare neccesary variable
let parentEl = $(targetElement);
let childEL = $(targetElement);
let parentLen = 0;
let domArrayElement = [];
let indexPush = [];
let elIndex = 0;
let parentIndex = [];
$(`${targetElement}`).parent().addClass('ghost-dropdown-menu');
let that;
// Find Dropdown parent element
parentEl.each(function (index, element) {
if ($(this).text().indexOf(hasChildDetectText) >= 0) {
parentIndex.push(index); // Make dropdown parent array index
parentLen++;
$(this).push(element);
$(this).addClass(hasChildrenClasses); // Add claas in dropdown element
$(this).append(`<ul class='${submenuUlClasses}'></ul>`); // Append submenu element
$(targetElement).css("opacity", "1");
}
if ($(this).text().includes(hasMegaMenuDetectText)) {
$(this).addClass(hasMegaMenuClasses);
that = $(this);
}
});
$(targetElement).css("opacity", "1");
$(`.${hasChildrenClasses}`).append(hasChildrenIcon);
if(!$(hasChildrenClasses).length){
$(targetElement).css("opacity", "1");
}
// Using loop to reach dropdown parent element
for (let i = 0; i < parentLen; i++) {
elIndex = 0 // Initial elemet value
// Find subitem element
childEL.each(function (index, element) {
let subitem = $(this).text().includes(subitemDetectText); // Find subitem element
if (subitem) {
if (elIndex >= parentIndex[i + 1]) { // Each loop will be break
return false; //Stoped each loop
}
if (elIndex <= parentIndex[i + 1] || elIndex >= parentIndex[parentIndex.length - 1]) {
if (!indexPush.includes(index)) { //Check if not index already insert
$(this).addClass(subitemLiClasses); // Add class in subitem element
let st = $(this).children().text(); // Find subitem inner text
$(this).children().text(st.replaceAll(subitemDetectText, "")); // Replace subitem inner text
domArrayElement.push(element); // Incert subitem element in dom array
indexPush.push(index); // incert subitem index in indexPush array
}
}
}
elIndex++; // increase element index value
});
$(`.${hasChildrenClasses} ul.${submenuUlClasses}:eq(${i})`).append(domArrayElement); // Append related subitem dom element into submenu
domArrayElement = []; // Make dom array element empty.
}
remove_text(hasChildrenClasses, hasChildDetectText);
if (options.multi_level) {
multiLevel();
}
if (options.mega_menu) {
megamenu(hasMegaMenuClasses, 3, 4, hasMegaMenuDetectText, submenuUlClasses);
}
}
$(document).ready(function () {
ghost_dropdown({
targetElement: "ul#nav li",
hasChildrenClasses: "menu-item-has-children",
hasChildrenIcon: "<svg width='19' height='10' viewBox='0 0 19 10' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M1.74805 1.52002L9.54883 9.00002L17.3496 1.52002' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>",
hasChildDetectText: "[has_child]",
submenuUlClasses: "ghost-submenu",
subitemDetectText: "[subitem]",
subitemLiClasses: "subitem",
multi_level: true,
mega_menu: true
});
});
}(jQuery));
</script>