x10Hosting Forums

Corporate Free Hosting for the Masses.


x10Hosting wishes you a great Year!

Register

Closed Thread
 
LinkBack Thread Tools Display Modes
x10Hosting Member

Join Date: Aug 2007
Posts: 13
Credits: 418
alloftheabove is on a distinguished road
 
12-25-2007, 04:17 PM
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 05:02 PM.
alloftheabove is offlineReport Post
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -5. The time now is 05:42 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios