473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Why doesnt this work in Opera ?

I have some javascript to restore the scroll position of a DIV over
postbacks. I've tested it on all major browsers and the only one it doesn't
work on is Opera. Could someone tell me why, and what I can do to (a) test
that it's Opera that's running and (b) how to get and set the scroll
position - scrollTop does not seem to work.

Here's the code :

// scrolls the "what" element given to it (the DIV scroll area)
// call from body onload (ie. on every postback)
function ScrollIt(what){
document.getElementById(what).scrollTop =
document.Form1.ScrollPos.value;
}

// saves the DIV scroll position (call from onscroll on the DIV)
function setdiv(val) {
document.Form1.ScrollPos.value = val.scrollTop;
}

I save the scroll position in a hidden field "ScrollPos" :

<input id="ScrollPos" type="hidden" value="0" name="ScrollPos"
runat="server">
Nov 18 '05 #1
1 1332
this is all clientside code. Perhaps you should hit up a clientside group,
or even a Opera specific one out there.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have some javascript to restore the scroll position of a DIV over
postbacks. I've tested it on all major browsers and the only one it doesn't work on is Opera. Could someone tell me why, and what I can do to (a) test
that it's Opera that's running and (b) how to get and set the scroll
position - scrollTop does not seem to work.

Here's the code :

// scrolls the "what" element given to it (the DIV scroll area)
// call from body onload (ie. on every postback)
function ScrollIt(what){
document.getElementById(what).scrollTop =
document.Form1.ScrollPos.value;
}

// saves the DIV scroll position (call from onscroll on the DIV)
function setdiv(val) {
document.Form1.ScrollPos.value = val.scrollTop;
}

I save the scroll position in a hidden field "ScrollPos" :

<input id="ScrollPos" type="hidden" value="0" name="ScrollPos"
runat="server">

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Gaurav | last post by:
Hello, i have some java script with in html. It runs fine on IE 6.0 but doesnt run on netscape 7.1 Can someone tell me whats the problem ? And how can i solve it. here is the url ...
13
by: Sheperd | last post by:
Hey everyone, I have this browser detect script and the validator is having problems with it, im trying to validate a page for XHTML 1.0 Transitional If you have any ideas or suggestions they...
1
by: The Master | last post by:
I ask this because I have a bread Crumb navigation on this new design layout: http://www.goldhilmedia.com/showbug/finished.html (the section I'm referring to is Main Category --> Sub Category...
6
by: Joe Morrison | last post by:
By my reading of the HTML standard: http://www.w3.org/TR/REC-html40/struct/tables.html the HTML shown below should display the text "Enter password" with the input field immediately adjacent,...
3
by: Paul Gorodyansky | last post by:
Hi, I have function that works via onkeypressed - for example, what to catch when a user presses a punctuation symbol such as '.' So I check keyCode for that - works just fine in Opera 8,...
10
by: patrick j | last post by:
Hi I'm wondering why my horizontal navigation lists don't align at the left in Opera as they do in IE6, IE7, Safari, Firefox and iCab? A URL with both of the horizontal lists is here: ...
0
by: Juna | last post by:
I have been working in vs2003, but now started to work in vs2005 but the problem, I have simple web application not website, which work i mean open in browser when we press F5 or run the...
1
by: radiodave | last post by:
I don't know how to ask this question but I'll try: I'm making a database (Access 2003) for an Opera buff. I have tables related like: each Opera has many Productions (Madame Butterfly has an...
2
by: panos100m | last post by:
Hi on page load a javascript functions (timedCount()) is executed (timer) which executes another javascript function (ajax function:findprov(divtowrite) ) in turn this calls a php file to query a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.