Customize the flexslider and add a map
-
Hey there!
First I want thank you for this awesome theme! The design is great; I like the clear structure and all the nice features.
I’m currently working on a modification of the slider. I want to display a map on the frontpage. The map should be displayed by using one of the buttons in the menu. Otherwise the standard slider should be shown. To implement a map I use the basic google maps plugin. I already solved the problem how to place a map on the frontpage.
Actually the tricky part is where to place the custom javascript code, that I can use the menu to display the slider or the map.
I already tried to customize the navwalker.php and to add the attribute ‘onclick’ in the function start_el, but it doesn’t work. Probably my attempt wasn’t that correct …
Anyone here got some ideas, how and where to add custom javascript in the menu?
My first attempt
// If item has_children add atts to a. if ( $args->has_children && $depth === 0 ) { …. $atts['onclick'] = 'document.getElementById("nav-map").style.display = "block"'; ….
Thank you in advance!
- The topic ‘Customize the flexslider and add a map’ is closed to new replies.