Finally manage to put some dhtml drop down menu onto WALHI website, though till i write this it still kinda buggy when using M$ IE and work great on Firefox.
I create style element script_dhtml for storing javascript and css file that used by dhtml dropdown menu. For top navbar I modify banner_menu and put javascript function inside html link tag and for left horizontal kampanye I modify the variable in subtopics_menu and change fetch section to <a class="subtopic2"
href="<?=$site->uri.$topics_array[$subtopic->id];?>/"
onMouseover="ddropdownmenu(this, event, <?=$subtopic->name;?>,
'150px')"
onMouseout="ddelayhidemenu()">&(subtopic.extra);</a>
Add several new global variable on code-global so that the dhtml
can get array for the subtopic.
And to give subtopic array on the javascript dhtml dropdown from
midgard subtopic function,
I came up with following lines of code<?
$campaigns_topic = mgd_list_topics(169);
?>
var campaign=new Array()
var c = 0
<?
while ($campaigns_topic_menu && $campaigns_topic_menu->fetch())
{ ?>
campaign[c] ='
<a href="<?=$site->uri.$topics_array[$campaigns_topic_menu->id];
?>/">&(campaigns_topic_menu.extra);</a>'
c++
<?}?>
Comments