{"id":423,"date":"2013-05-10T06:08:39","date_gmt":"2013-05-10T06:08:39","guid":{"rendered":"http:\/\/a1webdesignteam.com\/blog\/?p=423"},"modified":"2013-05-10T06:08:39","modified_gmt":"2013-05-10T06:08:39","slug":"togglemenu-defined-error-magento","status":"publish","type":"post","link":"https:\/\/a1webdesignteam.com\/blog\/togglemenu-defined-error-magento\/","title":{"rendered":"toggleMenu not defined error in Magento"},"content":{"rendered":"<p>I have run into this error after an upgrade to magento 1.4.1.1<\/p>\n<p>toggleMenu not defined.<\/p>\n<p>This is a Javascript error and is to my suprise why it\u2019s there in the first place!<\/p>\n<p>Anyway, here is a temporary solution hoping Magento will one day decide to fix it!<\/p>\n<p>Navigate to pp\/code\/core\/Mage\/Catalog\/Block\/Navigation.php file<\/p>\n<p>Around line 246: replace<\/p>\n<div>\n<div>\n<pre>$attributes['onmouseover'] = 'toggleMenu(this,1)';\r\n$attributes['onmouseout'] = 'toggleMenu(this,0)';<\/pre>\n<\/div>\n<\/div>\n<p>with<\/p>\n<div>\n<div>\n<pre>$attributes['onmouseover'] = 'Element.addClassName(this, \\'over\\')';\r\n$attributes['onmouseout'] = 'Element.removeClassName(this, \\'over\\')';<\/pre>\n<\/div>\n<\/div>\n<p>Drop a line if you have any cleaner solution!<\/p>\n<p><b>NOTE:<\/b><br \/>\nThey say practice makes it perfect! Instead of editing your core files as above please use the approach below as its a lot more cleaner than the one above:<br \/>\nYou can add this Javascript code in one of your javascript files that are used across the site.<\/p>\n<div>\n<div>\n<pre>function toggleMenu(el, over)\r\n{\r\n    if (over) {\r\n        Element.addClassName(el, 'over');\r\n    }\r\n    else {\r\n        Element.removeClassName(el, 'over');\r\n    }\r\n}<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I have run into this error after an upgrade to magento 1.4.1.1 toggleMenu not defined. This is a Javascript error and is to my suprise why it\u2019s there in the first place! Anyway, here is a temporary solution hoping Magento will one day decide to fix it! Navigate to pp\/code\/core\/Mage\/Catalog\/Block\/Navigation.php file Around line 246: replace [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[24],"tags":[],"_links":{"self":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/423"}],"collection":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/comments?post=423"}],"version-history":[{"count":0,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/423\/revisions"}],"wp:attachment":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media?parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/categories?post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/tags?post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}