-
-
Save anastransvelo/bf5e465b577dab910c19c2780cef28d0 to your computer and use it in GitHub Desktop.
Techmarket - Clickable Primary navigation parent menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_enqueue_scripts', 'tm_child_enqueue_custom_js', 30 ); | |
function tm_child_enqueue_custom_js() { | |
ob_start(); ?> | |
jQuery(document).ready(function($){ | |
if (jQuery(window).width() >= 1025){ | |
$(".primary-navigation .dropdown-toggle").click(function () { | |
var addressValue = $(this).attr("href"); | |
location.href=addressValue; | |
console.log(addressValue ); | |
}); | |
} | |
}); | |
<?php | |
$inline_js = ob_get_clean(); | |
wp_add_inline_script( 'techmarket-scripts', $inline_js ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.primary-navigation .menu-item-has-children:hover:after { | |
position: absolute; | |
display: block; | |
content: ' '; | |
width: 100%; | |
height: 50px; | |
} | |
.primary-navigation .dropdown-menu { | |
display: none; | |
top: 50%; | |
margin-top: 30px; | |
} | |
.primary-navigation .menu-item-has-children:hover > .dropdown-menu { | |
display: block; | |
} | |
.primary-navigation .nav .menu-item-has-children>.dropdown-menu { | |
top: 20px; | |
} | |
.primary-navigation .nav .menu-item-has-children .menu-item-has-children .dropdown-menu { | |
left: 100%; | |
top: 0; | |
margin-top: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment