views:

444

answers:

1

Well, what i want to do is having a lightbox and a sliding top panel. Both use mootools and both seem to use different versions.

It does not work if comment out one of these although they are booth the actual mootools library.

<!a possible js config. either these two are commentented out, or the mootols.svn.js
<!-- libraries/frameworks for milkbox-->
<!--script type="text/javascript" src="js/mootools-1.2.3-core-yc.js"></script>
<script type="text/javascript" src="js/mootools-1.2.3.1-more.js"></script-->
<!-- mootools for the sliding top panel. should work also with the one imported above, so i was going to deactivate the one below-->
<script type="text/javascript" src="js/mootools.svn.js"></script> 
<script type="text/javascript" src="js/milkbox.js"></script>
<script type="text/javascript" src="js/panel.js"></script>

So no matter wich one (*-1.2.3-core-yc and -more.js or mootools.js) i comment out, always one of the features doesnt work.

While it actually should be possible as both are mootools. Does someone have a solution for this? (i have heard about the term namespace and know roughly what it means, but i dont know how to use it)

thanks a lot in advance,

benny

+3  A: 

You cannot use namespacing to great effect with frameworks that do prototyping (such as mootools or prototype).

In your case, I can assume the sliding top panel is a mootools 1.11 plugin (your link does not work), the lightbox is 1.2.3...

There is an abstraction layer that brings mootools 1.11 compatibility into 1.2 - check http://www.siafoo.net/article/62, there are also several posts on this on the mootools mailing list (http://groups.google.com/group/mootools-users?pli=1)

Your objective here should be - get rid of mootools 1.11, put the compatibility code in and try to get the panel to work (there may need to be some slight changes here and there but it's not that big a task). A while back I faced the same dilemma and ended up writing a slide-in panel for 1.2.3 from scratch.

Also, consider the WebKreations slide in http://web-kreation.com/demos/login%5Fform%5Fmootools%5F1.2/ - perhaps you can use that as your alternative.

Good luck :)

Dimitar Christoff
thanks a lot for the great answer 'though this reply is a bit late :)
benny