Closed Bug 287368 Opened 20 years ago Closed 20 years ago

scrolling div via java script does not work (no doScroll method)

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: stevemartin, Assigned: bugzilla)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050313
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050313

Problem unable to scroll div using scroll buttons, work in IE but not Mozilla

Java file listed below
	var oTxt;
	var oTimer;
	var scrollInterval = 5;
	
	function scrlDown()
	{
		oTxt = document.getElementById("divScroll");
		oTimer = window.setInterval(sd, scrollInterval);
	}
	
	function sd()
	{
		oTxt.doScroll("scrollbarDown");
	}
	
	function scrlUp()
	{
		oTxt = document.getElementById("divScroll");
		oTimer = window.setInterval(su, scrollInterval);
	}
	
	function su()
	{
		oTxt.doScroll("scrollbarUp");
	}
	
	function stopScroll()
	{
		window.clearInterval(oTimer);
	}


Reproducible: Always

Steps to Reproduce:
1.load page as above
2.click on button scroll down
3.nothing happens
4. try in IE contact us scrolls

Actual Results:  
contact us does not scroll

Expected Results:  
contact us should scroll
Tools -> JavaScript Console:
    Error: oTxt.doScroll is not a function
    Source File: http://freetolook.no-ip.com/skyincentives/scroll.js
    Line: 13

The doScroll method ("Simulates a click on a scroll-bar component") appears to
be msie-proprietary dom. Use for instance element.scrollTop += 10; or the like,
that appears to work in both mozilla and ie.

As a personal note, I think it's a bad idea to not use familiar user interface
components to implement common user interface things (scrollbars for scrolling!).
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Summary: scrolling div via java script does not work → scrolling div via java script does not work (no doScroll method)
You need to log in before you can comment on or make changes to this bug.