0

I need to create a tabbed menu on a Drupal website. The drupal installation is a good ould Drupal 4.7. In order to create tabbed menu I use tabify plugin for Jquery. The problem is that I cannot get it working. It seems that the Jquery doesn't load. I put the code (below) on the website where I would like to have the menu. It didnt work. Then I put it on the main drupal page and on every template file. Not working either. What is the cause of that? Any advice appreciated. Here is my code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://jquery-tabify.googlecode.com/files/jquery.tabify-1.4.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
        // <![CDATA[

        $(document).ready(function () {
            $('#tabbed_menu').tabify();
        });

        // ]]>
    </script>

<ul id="tabbed_menu">
        <li class="active"><a href="#description">Treatment</a></li>
        <li><a href="#usage">Prices</a></li>

        <li><a href="#download">FAQ</a></li>

    </ul>
    <div id="description" class="content">      
some text
</div>


        <div id="usage" class="content">
        <h2>Prices</h2>
some text           
</div>

    <div id="download" class="content">
some text
                        </div>

And CSS:

#tabbed_menu{   padding: 0;}#tabbed_menu LI{    display: inline;}#tabbed_menu LI A{ background: #EDF;   padding: 10px;  float: left;    border-right: 1px solid #CCF;   border-bottom: none;    text-decoration: none;  color: #000;    font-weight: bold;}#tabbed_menu LI.active A{    background: #E07;   color: #FFFFFF;}.content_tabbed{    float: left;    clear: both;    border: 1px solid #CCF; border-top: 1px solid #CCF; border-left: 1px solid #CCF;    background: #FFF;   padding: 10px 20px 20px;    width: 100%;    border-bottom: 1px solid #CCF;}

And the link is: http://www.medicetics.com/Laser_hair_removal_72.html

8
  • 1
    Is it actually not loading, or just not running? Use a resources viewer to see whether it is actually loaded. Commented Feb 2, 2011 at 12:47
  • 1
    Could you give a link to a non-working page? Commented Feb 2, 2011 at 12:48
  • 2
    Are you getting any javascript console errors? Can you provide a link to the site in question? Could it be due to the HTTPS delivery of jquery, try HTTP unless you specifically need it. Commented Feb 2, 2011 at 12:48
  • 1
    Is "jquery.tabify-1.4.js" accessible ? Isn't it in some subdirectory so it can't be loaded ? Commented Feb 2, 2011 at 12:48
  • Did you already ask this question? But i think the file path for tabify could be playing up?? Commented Feb 2, 2011 at 12:52

1 Answer 1

1

You're loading jQuery twice on that page.

Once here:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>

And once here:

<script src="http://www.medicetics.com/themes/glowmedical/js/jquery.min.js"></script>

Since the tabify plugin is being loaded between the two, the second jQuery overrides it, so you get the error that tabify is undefined.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks, I removed one, I see some progress. But the tabs are not loading now...Any idea why?
@Vafello, open up the console in firefox by installing Firebug, or in Chrome by opening the Developer Tools. There you will see that it's just moved on to the next error: flowplayer is undefined. Looks like you didn't include that script.
What flowplayer has to do with that??Actually it's a website that I am just working on to create this tabbed menu. It's totally messy, but how can I do it?
@Vafello, ok I can't walk you through every step because there are probably going to be more errors after you fix this one. You really need to open up the console, it will tell you what the error is, and you can even click it to go to the line it occurred on. Currently, the error is that flowplayer is undefined and that's because a script near the bottom of the page is trying to call it. I hope that gets you on your way, but do make friends with the console ;)
Thanks a lot anyway. Flowplayer had nothing to do with that. It seems that the initialising code was placed 2 times as well and this was causing the problem. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.