| Post |
|
ryanpaulyoung - Member
6:17 pm - August 2, 2011
posts 3 |
| |
|
Post edited 10:18 pm - August 2, 2011 by ryanpaulyoung
AMAZING plugin, thanks so much. Has anyone been able to build a custom nav, where the current selected navigation item is highlighted? Hope that makes sense... just need to append a css class, but have NO idea how...
thanks for any insights... oh, and I will GLADLY make a donation, just let me know how much!
|
|
|
ryanpaulyoung - Member
2:53 pm - August 4, 2011
posts 3 |
| |
|
Ok... well for anyone who's interested, this is how I solved my issue - paste this into your functions file and modify accordingly... there HAS to be an easier way, just one solution for the time being....
add_filter('awp_ajax_nav_actions', awp_compatible); function awp_compatible($actions){ $actions[] = 'var str = window.location.href; var newCurrentNav = str.slice(35); var oldSelectedNav = document.getElementById("menu").getElementsByTagName("div")[0].id; var x=0; var checkMe = ""; var myURLS = new Array("home","blog","news","tour","media","shop","discography","bio","contact","adhoc"); for (x=0;x<=10;x++){ checkMe = "#awp::"+myURLS[x]; if(str.indexOf(checkMe)!=-1){ document.getElementById(oldSelectedNav).setAttribute("id", newCurrentNav); } }'; return $actions; }
|
|
|
ryanpaulyoung - Member
3:02 pm - August 4, 2011
posts 3 |
| |
|
Correction...
add_filter('awp_ajax_nav_actions', awp_compatible); function awp_compatible($actions){ $actions[] = 'var str = window.location.href; var oldSelectedNav = document.getElementById("menu").getElementsByTagName("div")[0].id; var x=0; var checkMe = ""; var myURLS = new Array("home","blog","news","tour","media","shop","discography","bio","contact","adhoc"); for (x=0;x<=10;x++){ checkMe = "#awp::"+myURLS[x]; if(str.indexOf(checkMe)!=-1){ document.getElementById(oldSelectedNav).setAttribute("id", myURLS[x]); } }'; return $actions; }
|
|