Closed Thread
Results 1 to 1 of 1

Thread: javascript problems

  1. #1
    alloftheabove is offline x10Hosting Member alloftheabove is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    13

    Question javascript problems

    I seem to be having problems with some javascript I made. WARNING: the javascript I will show you uses Prototype.js || I will also include the page source in case it helps.
    Javascript:
    Code:
    // pulldownExample javascript
    var handl = {
    //pulldown handler
    pdh: function(e){
    var desArray = e.descendants();
    desArray.each(function(item){
    if (item.hasClassName('hidden') == true){
    item.removeClassName('hidden');
    item.addClassName('shown');
    } else if (item.hasClassName('shown') == true){
    item.removeClassName('shown');
    item.addClassName('hidden');
    }
    });
    }};
    $('outer').observe('click', handl.pdh.bindAsEventListener(obj));
    and the html:
    Code:
    <title>Pulldown Link Example</title>
    <script type="text/javascript" src="prototype.js"></script>
    <style type="text/css">
    <!--
    #outer div.more a {
    display: none;
    }
    #outer div.click a {
    display: inline;
    }
    div.hidden {
    display: none;
    }
    div.shown {
    display: inline;
    }
    div#outer {
    width: 100%;
    }
    -->
    </style>
    <script type="text/javascript" src="pulldownExample.js"></script>
    </head>
    <body>
    <div id="outer">
    <a>Lorem</a>
    <div class="hidden">
    <a>Ipsum</a><br />
    <a>Dolor</a>
    </div>
    </div>
    </body>
    </html>
    The point is to make the hidden div appear when the user clicks on the 'outer' div.
    Both firebug and the Firefox error console tell me that "$('outer') has no properties".
    I don't quite understand, so could someone possibly help me out??

    EDIT: please delete this post. I'm moving over to the scripting forum
    Last edited by alloftheabove; 12-25-2007 at 04:02 PM.

Closed Thread

Similar Threads

  1. A question about javascript files
    By rlodge in forum Programming Help
    Replies: 6
    Last Post: 12-19-2007, 11:26 AM
  2. Problems...problems...problems...
    By eternal-empire in forum Free Hosting
    Replies: 4
    Last Post: 09-21-2007, 03:53 PM
  3. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM
  4. Some nice-simple JavaScript effects !!
    By careerbridge in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 07-13-2006, 08:36 AM
  5. problems, problems
    By joandajer in forum Free Hosting
    Replies: 5
    Last Post: 01-29-2006, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers