View Full Version : Is this even possible

03-20-2003, 09:35 AM
I have gone a month without figuring this out, is it even possible?
on my site (http://www20.brinkster.com/amplifieddesign/), I have I contractable menu script that is pretty simple. Notice when u click the "submenu Header" section the links show. Instead of just poping everything down to make room for the links, can I Animate it down? I have read john's tutorial at www.pageresource.com in css/dhtml section under "an object in motion", but It only tells you how to do it from absolute positions. I looked in my sam's JS book, still nothing. If anyone can help me, or refer me to a script that animates and may be help to me, or anything at all. I would REALLY APPRIECIATE IT!!!! Also, is this even possible? If not, I probably can do some variable editing and absolute positioning to do it, yes?

03-20-2003, 10:04 AM
Yup, it's possible, but it depends entirely upon your level of knowledge/expertise.

I've created an entire Smart Object API which includes an Animator, but that's kind of overkill for a piece of work like this.

I can't write the code for you, because I don't have the time, but I will be happy to help you out with any questions and also send you the code I mentioned, if you want.

Anyway, here's some tips:

Relative vs. absolute positioning makes little difference. So long as you get the co-ordinate system straight in your head, the code itself is practically the same. However, relative to what, exactly? ...the parent object. If you ensure that the parent is the BODY, then you will make life easier for yourself.

You should use DIVs, and indeed you are doing. Basically, whatever container you use has to be block level rather than inline.

Think around the movement problem like this: set the submenus container element to overflow: hidden. Then, animate the height at the same time as animating the top property of the menus below.

Most of this will be planning :) I'm sure you'll be OK once you start off.

Oh yeah and one last thing - make sure you read up on setInterval etc. because you'll need it! :D

::] krycek [::

03-20-2003, 10:12 AM
Man, I am not totally sure I got that.

I am used to picking apart scripts, rather than making my own. I was hoping this was going to be a simple solution. Can you explain the relative positioning,how I get the animation to animate, and what is overflow: hidden.

I am sorry, but I am a n00b at JSing.

03-21-2003, 05:04 PM
What is a "Smart Object API" and, may I see it? The only way I have found to do this so far is with absolute positioning. How can I animate something without absolutely positioning?

03-21-2003, 05:38 PM
One way is to use the clip method to gradually reveal the layer as you move it down.

03-21-2003, 06:00 PM
Originally posted by mattover-matter
What is a "Smart Object API" and, may I see it? The only way I have found to do this so far is with absolute positioning. How can I animate something without absolutely positioning?

yup, you can see it :) it's open source and I don't have loads of time to develop it because other, paying stuff takes up most of my time... but, PM or email me and I will email you the code :)

::] krycek [::

03-21-2003, 06:13 PM
While animaiton may look cute to a visitor the first couple of times he/she opens/closes a submenu header, it very soon will become nothing more than an annoyance that slows them down in reaching the information they are looking for.
Just remember two principles:
2. Content - first; Functionality - second; Presentation - third; Cute Little Gismos - last (and as long as they do not conflict with anything that comes before them);

03-21-2003, 07:44 PM
not to code. presentation a gismos kind of go together, which will be boosted by this. My functionality will be the same, pretty good. My content is worriless. I just really want this script :-} It is the only "gismo" on my page pretty much, so far :D

03-21-2003, 07:58 PM
the big problem with this is that I want to be able to have all menus shut, or open. So it is imperritive that I do not use absolute positioning. Else I will have to have a set of coordinates for each possible combination, which may get messy.

03-23-2003, 04:37 PM
I dont know exactly how it works, I'm pretty good at JavaScript but, well it would only work in IE5+

mything.style.filter = 'whatever filter';
// Do whatever action

Might Help.