I try to find a scroller that is built in Ajax which makes it possible to scroll a part of a table/div (vertical).

Ex: You have two text areas; "A" and "B", when you press "down" it smoothly shows another text area ("C") and "A" disappears and "B" replace it, etc.

Dont know how to explain it better. Hope it makes some sense to someone.

Thanks...

Recommended Answers

All 3 Replies

You should make 2 functions:

- ShowObject(objectId) - CloseObject(objectId) And two global variables:

var maxHeight = 300;
var curHeight;

ShowObject(objectId) sets a Interval of for example every 20 miliseconds in which he calls itself again. Each time the function gets called it increases the height with 3px. If the maximum height has been reached (for example 300px) it stops the interval. CloseObject(objectId) does exactly the same as ShowObject(objectId) , but decreases the height at each function call until it reaches for example 10px.

To retrieve the object's height you should use the codeline curHeight = document.getElementById(objectId).height Good luck!

~G

Thanks..

I was more about looking for a ready script since it's probably quite difficult to make for a PHP newbie like myself.

You don't happen to know where I could find such a script?

Well, first of all there is no AJAX nor PHP required to do this. Its all DHTML and JavaScript. If you are not able to write your own functions, you could consider using jQuery. Click the link below to go to a tutorial page on Show and Hide of a element.

http://www.learningjquery.com/2006/09/slicker-show-and-hide

Although you now have the functions to show and hide elements, you also want to have that only 2 elements of 3 appear at a time. Unfortunatly, that is way to specific to be able to find a already written script on the internet that matches your specific requirements. I think you need to create a function for that on your own ;)

~G

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.