- Create Account

Thought I'd better create a forum for this :)

Forums > Cross-Browser DHTML API > Thought I'd better create a forum for this :)
Author
Message

1) Angus Turnbull Group: Guests
IP: 210.54.--.--
So, is anyone using this as a reference for customising the other scripts, or perhaps as a basis for new projects?

Also, I noticed a nice collection of other libraries available at http://www.timmorgan.info/dhtml/libraries if you're looking for something a little more heavyweight.

- Angus.

2) Sid Group: Guests
IP: 66.119.--.--
Yes, you should have created a forum for this, 'cause I want to tell the world that THIS SCRIPT IS GREAT! Just half an hour of coding and my Please wait... sign goes vroom like Angus...

- Sid

3) Angus Turnbull Group: Guests
IP: 203.96.--.--
Hey, glad you've found it useful :).

4) Geoff Group: Members
Posts: 2 Joined: 18 Dec 2003 Location: Toronto IP: 24.192.--.--
I'm trying to get 4 layers to move (slide) on and off the page (only one appears at a time). I don't imagine your bezier function is the thing, but I'm not sure what to use as a model.

A lot of scripts I find on the net don't function in mozilla.

update: I just found a couple scripts to try to learn this from.
http://www.13thparallel.org/js/lib_animation.js
http://catcode.com/dominfo/domUtils.js

the second one has a generic move that works properly, but I'm lost as how to get a smooth left-right motion

5) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 210.185.--.--
My API is pretty light, it only provides the necessary stuff that differs between browsers, rather than high-level "move" or "drag" functions etc. Then again it's only 1 or 2kb in size.

What you need to do is use either the window.setInterval or window.setTimeout JavaScript commands to call a function every 50 milliseconds or so (so it works out at 20 frames per second, which is smooth-ish animation). That function can then use my layer API to set the position of a layer, and keep a counter of animation frames etc, like the bezier animation in the example.

Good luck - Angus.

6) Flanagan Group: Members
Posts: 50 Joined: 11 Mar 2005 Location: USA IP: 140.175.--.--
Angus,

What do you think of the DynAPI JavaScript library?

http://sourceforge.net/projects/dynapi/

There is also an IDE, and a variety of other packages written for/with DynAPI, with more in the works.
 
IDE  for DynAPI: http://sourceforge.net/projects/dynapyide/
Network/Messaging distribution of DynAPI: http://sourceforge.net/projects/dynatalk/
UML Generator written using DynAPI: http://sourceforge.net/projects/bcuml/
Me

7) Flanagan Group: Members
Posts: 50 Joined: 11 Mar 2005 Location: USA IP: 140.175.--.--
Geoff,

If you're still interested in scripts for "sliding" layers (or DIVs) around, it's a fairly easy thing to do. I wrote some code to do this for a project I did over 7 years ago. It was possible even with the browsers of that day, so it's probably even easier now. Back then, as I recall, I had to check the browser type, and use layers for Netscape or DIVs for MSIE.

Now, I'd recommend ONLY using DIVs, since all modern browsers have good support for DIVs. Use the SetInterval or SetTimeout commands as Angus suggested, and it should be a breeze.

Just  FYI, In the application I wrote, I had several layers sliding around all at the same time, using the SetTimeout command, adjusting the top and left properties, as necessary.
Me

8) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.36.--.--
I'm not a fan of heavier APIs -- they take too long to download!

My API here is realyy getting a little outdated as most v5+ browser scripts don't need it. If you code to standards there's very little you need in the way of an API now...

- Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.