JS images link seems to be acting relative not absolute (plus.gif not showing up)

dgtlmoon - July 19, 2007 - 05:12
Project:Taxonomy dhtml
Version:5.x-2.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

the plus.gif isnt showing up in my menu.

in my access log i get

page not found 07/19/2007 - 3:04pm blog/modules/taxonomy_dhtml/plus.gif not found.

which inidicates it's loading relative of /blog (the current path)

     // if (window.opera) return; // Opera 7 works well, so commenting this

-    actuator.parentNode.style.backgroundImage = "url(modules/taxonomy_dhtml/plus.gif)";
+    actuator.parentNode.style.backgroundImage = "url(/modules/taxonomy_dhtml/plus.gif)";
     actuator.onclick = function() {
         var display = menu.style.display;
         this.parentNode.style.backgroundImage =
-            (display == "block") ? "url(modules/taxonomy_dhtml/plus.gif)" : "url(modules/taxonomy_dhtml/minus.gif)";
+            (display == "block") ? "url(/modules/taxonomy_dhtml/plus.gif)" : "url(/modules/taxonomy_dhtml/minus.gif)";
         menu.style.display = (display == "block") ? "none" : "block";

         return false;

#1

blb - August 7, 2007 - 21:58
Version:4.7.x-1.x-dev» 5.x-2.2

i had a similar problem in 5.x-2.2 version. the value for module path doesn't work for installations not in root because the value of module path is wrong - it doesn't include the base of the url.

to fix this i changed the js statement:

     drupal_add_js("$(document).ready(function() { initializeMenu('" . ltrim((base_path().$modpath),'/') . "') } );", 'inline');

#2

darthclue - April 12, 2009 - 04:15
Status:active» closed

This module is no longer being actively developed as it duplicates functionality that can be obtained through the usage of taxonomy_menu ( http://drupal.org/project/taxonomy_menu ) and dhtml_menu ( http://drupal.org/project/dhtml_menu ).

 
 

Drupal is a registered trademark of Dries Buytaert.