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) SidGroup: Guests IP: 66.119.--.--
Posted:
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 TurnbullGroup: Guests IP: 203.96.--.--
Posted:
Hey, glad you've found it useful :).
4) GeoffGroup: Members Posts: 2Joined: 18 Dec 2003Location: TorontoIP: 24.192.--.--
Posted:
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.
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 TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 210.185.--.--
Posted:
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) FlanaganGroup: Members Posts: 50Joined: 11 Mar 2005Location: USAIP: 140.175.--.--
Posted:
Angus,
What do you think of the DynAPI JavaScript library?
7) FlanaganGroup: Members Posts: 50Joined: 11 Mar 2005Location: USAIP: 140.175.--.--
Posted:
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 TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 202.36.--.--
Posted:
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...