Generic sliding menu -- general javascript comments, too

B

Bura Tino

Hi,

I would like to have the kind of menu on the left that can be found on a lot
of websites: it slides nicely into place when the document is scrolled. Many
websites also offer the code. You need to put something into the style
section, some code into the head section, have an onload event and then
usually some code before the ending </body> tag. I would argue that while
such code is very educational, it is unmanageable for anyone writing a broad
web-based application or a website.

Just think of the complexity that it adds. For example, I'm using java
server pages and many of pages are as little as 20 lines of code. If I want
to have a sliding menu on each page, I'll have to add _at least_ 40 lines of
code to each page and then be mindful of its location, integrity, etc.

So, has anyone written a generic sliding layer code that is

1. organized as a .js file (or a couple of .js files)
2. reasonably customizable (name of sliding layer, left, top, speed of
sliding into place)
3. doesn't have functions like "setup()" or "check()" or "start()" which are
sure to interfere with other js packages

?

Thanks for any info.

Bura


PS: On a more general note, I would argue that if anyone wants his/her code
used, it should be delivered as described above. While I'm an (aspiring)
professional web developer I feel that writing reliable javascript code is a
whole profession by itself. I would like to be a consumer and a "reseller"
of this wonderful technology, I want to avoid dealing with all the annoying
but necessary stuff like cross-browser compatibility. My idea of a perfectly
written javascript package? http://javascript.cooldev.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top