The relational position of an entity, when compared to another entity with fixed position. Typically used, for example, to define location within a file or byte buffer from which information should be read.
Questions tagged [offset]
3019 questions
21
votes
3 answers
Detecting offset of an element on scroll in javascript / jQuery
I am looking to calculate the distance between an element and the top of the document window. On scroll I am able to get the initial value but it does not change. How can I find this value and what the number has changed to on…

jeffreynolte
- 3,749
- 11
- 41
- 64
20
votes
5 answers
Calculate the UTC offset given a TimeZone string in JavaScript
Using the standard JS library (ECMA5), without using momentjs or external libs, how do you calculate the UTC offset given a TimeZone string such as "Europe/Rome" or "America/Los_Angeles"?
UTC Offsets may depend on whether it is DST or not, so it…

GM Lucid
- 1,404
- 2
- 12
- 15
19
votes
2 answers
How can I determine the distance of an object to the right browser window border
How can I possibly figure out the distance from an object (div) to the right browser window border?
http://www.screencast.com/t/ryNgwa4E
Thanks!

Nicole Loyal Windham
- 207
- 1
- 2
- 4
19
votes
5 answers
PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string
I get following error:
PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string
on this line:
if ($uploadZoneData[1]['size'] != 0) {
On php 7.4 i had any troube but with php 8 i have.
What can be the…

Omexlu
- 193
- 1
- 1
- 7
19
votes
1 answer
Why file starting offset in mmap() must be multiple of the page size
In mmap() manpage:
Its prototype is:
void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
and description:
The mmap() function asks to map 'length' bytes starting at offset 'offset'
from the file (or other object)…

password636
- 981
- 1
- 7
- 18
18
votes
4 answers
How does the C offsetof macro work?
Possible Duplicate:
Why does this C code work?
How do you use offsetof() on a struct?
I read about this offsetof macro on the Internet, but it doesn't explain what it is used for.
#define offsetof(a,b) ((int)(&(((a*)(0))->b)))
What is it trying…

Samuel Liew
- 76,741
- 107
- 159
- 260
18
votes
2 answers
How can I offset a scaffold widget in Flutter?
I want to design a custom navigation window like the one below.
I planned to:
Create my navigation widget
Create my news feed widget
Stack both widgets (news feed on top of the navigation)
If the menu icon is clicked, translate the news feed…

Nirup Iyer
- 1,215
- 2
- 14
- 20
18
votes
4 answers
Difference between offsetParent and parentElement or parentNode
I have a following DOM structure
DIV has its overflow set to auto so if table grows bigger - it…