Questions tagged [offset]

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.

3019 questions
1441
votes
28 answers

offsetting an html anchor to adjust for fixed header

I am trying to clean up the way my anchors work. I have a header that is fixed to the top of the page, so when you link to an anchor elsewhere in the page, the page jumps so the anchor is at the top of the page, leaving the content behind the fixed…
Matt Dryden
  • 14,465
  • 3
  • 16
  • 13
275
votes
14 answers

Can you control how an SVG's stroke-width is drawn?

Currently building a browser-based SVG application. Within this app, various shapes can be styled and positioned by the user, including rectangles. When I apply a stroke-width to an SVG rect element of say 1px, the stroke is applied to the rect’s…
Steve
  • 3,483
  • 5
  • 21
  • 20
213
votes
18 answers

Equivalent of LIMIT and OFFSET for SQL Server?

In PostgreSQL there is the Limit and Offset keywords which will allow very easy pagination of result sets. What is the equivalent syntax for SQL Server?
Earlz
  • 62,085
  • 98
  • 303
  • 499
205
votes
7 answers

Get position/offset of element relative to a parent container?

How can I retrieve the offset of a container relative to a parent with pure JS?
matt
  • 42,713
  • 103
  • 264
  • 397
131
votes
10 answers

Laravel Eloquent limit and offset

This is mine $art = Article::where('id',$article)->firstOrFail(); $products = $art->products; I just wanna take a limit 'product' This is wrong way $products = $art->products->offset($offset*$limit)->take($limit)->get(); Please give me…
Sang Trần
  • 2,147
  • 4
  • 13
  • 20
119
votes
6 answers

Using jquery to get element's position relative to viewport

What's the proper way to get the position of an element on the page relative to the viewport (rather than the document). jQuery.offset function seemed promising: Get the current coordinates of the first element, or set the coordinates of every…
DA.
  • 39,848
  • 49
  • 150
  • 213
110
votes
2 answers

How can I get an object's absolute position on the page in Javascript?

I want to get an object's absolute x,y position on the page in Javascript. How can I do this? I tried obj.offsetTop and obj.offsetLeft, but those only give the position relative to the parent element. I guess I could loop through and add the…
Kip
  • 107,154
  • 87
  • 232
  • 265
95
votes
2 answers

Check if element is visible on screen

Possible Duplicate: jQuery - Check if element is visible after scroling I'm trying to determine if an element is visible on screen. In order to to this, I'm trying to find the element's vertical position using offsetTop, but the value returned is…
Robert
  • 951
  • 1
  • 7
  • 3
95
votes
8 answers

Get div's offsetTop positions in React

I am trying to implement a List view in React. What I am trying to achieve is that to store the list headers informations and register the components and register the scroll event. every time when user scroll the window, I'd like to take out the…
JavaScripter
  • 4,282
  • 9
  • 37
  • 45
93
votes
8 answers

how to get right offset of an element? - jQuery

This is probably a really simple question, but how do I go about getting the right offset of an element in jQuery? I can do: $("#whatever").offset().left; and it is valid. But it seems that: $("#whatever").offset().right is undefined. So how does…
Alex
  • 64,178
  • 48
  • 151
  • 180
91
votes
5 answers

offsetTop vs. jQuery.offset().top

I have read that offsetLeft and offsetTop do not work properly in all browsers. jQuery.offset() is supposed to provide an abstraction for this to provide the correct value xbrowser. What I am trying to do is get the coordinates of where an element…
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405
85
votes
12 answers

Changing the position of Bootstrap popovers based on the popover's X position in relation to window edge?

I have scoured the Internet far and wide and while I found this stackoverflow post insightful Is it possible to change the position of Bootstrap popovers based on screen width?, it still didn't answer my question, likely due to my trouble…
j0e
  • 1,441
  • 1
  • 15
  • 17
56
votes
15 answers

jQuery UI sortable scroll helper element offset Firefox issue

I have a problem with a jQuery UI 1.7.2 sortable list in Firefox 3.6, IE7-8 work fine. When I'm scrolled down a bit, the helper element seems to have an offset of the same height that I'm scrolled down from the mouse pointer which makes it…
James
  • 12,636
  • 12
  • 67
  • 104
55
votes
4 answers

How to change start offset for topic?

It is possible to change the start offset for a new topic? I would like to create a new topic and start reading from the offset 10000. How?
Piotr Sobolewski
  • 2,024
  • 4
  • 28
  • 42
53
votes
4 answers

undefined offset PHP error

I am receiving the following error in PHP Notice undefined offset 1: in C:\wamp\www\includes\imdbgrabber.php line 36 Here is the PHP code that causes it:
user272899
  • 871
  • 5
  • 16
  • 22
1
2 3
99 100