By divyeshvk on
I am upgrading my site from drupal 4.7x to 5.1x
all things are done properly except following java script code is not running
this code i used into page.tpl.php into my drupal 4.7x site
If I want to use same functions into my drupal 5.1x site
what I have to do?
here I used bluemarine theme page.tpl.php,I declare #primary-nav into my style.css
Into style.css
ul#primary-nav,
ul#primary-nav ul {
margin: 0;
padding: 0;
width: 160px; /* Width of Menu Items */
background: #FAFAF0; /* IE6 Bug */
font-size: 100%;
}
ul#primary-nav li {
position: relative;
list-style: none;
}
Into page.tpl.php
I already read changes which are used for js of 5.1
but I can't get proper output.
Comments
post your entire
post your entire page.tpl.php. Are you getting javascript errors?
you could rely on jquery to do the above too.
of course all this may work only if thr primary-nav exists on you page. If you have firefox and its firebug extension debugging this would be straightforward.
Thank you for your
Thank you for your replay.
but my problem is not solved yet
Here is my page.tpl.php,This is I used into my drupal 4.7 site,same theme i can use in drupal 5.1
print $language " xml:lang="
print $language">print $head_titleprint $headprint $stylesprint $script/* Needed to avoid Flash of Unstyle Content in IE */if ($logo) {print $base_path " title="
print t('Home')">print t('Home')" />}
print $base_path " title="if ($site_slogan) {print t('Home')">print($site_slogan)}if (isset($secondary_links)) {print theme('links', $secondary_links)}if (isset($primary_links)) {print theme('links', $primary_links)}| Login | Register | Member benefits
| Partner with us | Send Suggestions | Refer site
}//print $search_boxprint $headerif ($sidebar_left) {print $sidebar_leftvar navItems = document.getElementById("primary-nav").getElementsByTagName("li");}) for (var i=0; i < navItems.length; i++) { if(navItems[i].className == "expanded") { navItems[i].onmouseover=function() { this.className += " over"; }) navItems[i].onmouseout=function() { this.className = "expanded"; }) } }}if ($mission) {print $mission}print $breadcrumbprint $titleprint $tabsprint $helpif ($messages != ""){print $messages}print $content;Suckerfish Menus eh?
I've implemented these menus on about 10 different sites without difficulty. The biggest issue is making sure that the container div that your menus are in has the right ID.
You are currently looking in 'primary-nav' for your menu, is that where it is? It might have changed its container wrapper with the change of theme.
Dave
My site: http://www.unitorganizer.com/myblog
Thank you for your
Thank you for your reply.
#primary-nav into my style.css of blumarine(Ver drupal-4.7)
same theme I used for my Drupal 5.1 upgradation.theme placed into
drupal-5.1 >> sites >> all >>themes >> mytheme(changing theme name from bluemarine to mytheme)
I already change my code
$(document).load.(function(){ var navItems = document.getElementById("#primary-nav").getElementsByTagName("#li"); for (var i=0; i < navItems.length; i++) { if(navItems[i].className == "expanded") { navItems[i].onmouseover=ready(function() { $(this).className += " over"; }) navItems[i].onmouseout=ready(function() { $(this).className = "expanded"; }) } } });as follow