Questions tagged [position]

Position refers to the location of an element relative to its container, typically on the horizontal and vertical axes.

In computing, position closely relates to the geometrical definition of a position or position vector, also known as location vector or radius vector, which is a Euclidean vector that represents the position of a point P in space in relation to an arbitrary reference origin O. Usually denoted x, r or s, it corresponds to the displacement from O to P.

In simplified terms, position is used in reference to the location of a 'child' entity within a two-dimensional or three-dimensional space, the boundaries of which are referred to as the 'container' or 'parent'.

9210 questions
42
votes
24 answers

jQuery UI dialog box not positioned center screen

I have a jQuery dialog box that is meant to position in the middle of the screen. However, it seems slightly off-center vertically. Here is the code: $('#add_box').dialog({ autoOpen: true, width: 300, modal: true, resizable:…
David
  • 16,246
  • 34
  • 103
  • 162
41
votes
9 answers

How do I get the coordinate position after using jQuery drag and drop?

How do I get the coordinate position after using jQuery drag and drop? I want to save the coordinate to a database, so that next time I visit, the item will be in that position. For example, x: 520px, y: 300px? EDIT: I am PHP and mysql programmer…
michael
41
votes
2 answers

combining wrap_content on parent and fill_parent on child

Setting two or more elements of a linear layout the same height seems to be a great problem. I want to set four buttons in a row to the same height. android:layout_height="wrap_content" does it for the moment but when the text on one of the buttons…
nob
  • 1,067
  • 1
  • 11
  • 18
41
votes
3 answers

How do I place a button next to a heading?

I thought using float: right; would fix this, but it makes the button appear outside of the div. How do I solve this? HTML

Title

CSS #main { width: 200px; border: 1px dotted black; } h1…
Joe
  • 461
  • 1
  • 4
  • 5
41
votes
4 answers

Determine mouse position outside of events (using jQuery)?

I need to get a hold of the absolute mouse position / coordinates (X and Y) using (preferably) jQuery like in this tutorial but outside of any JavaScript event. Thank you.
pbz
  • 8,865
  • 14
  • 56
  • 70
40
votes
1 answer

Position Fixed Not Working for Header

I am trying to create a very simple effect where the navigation sticks to the top of the page as you scroll down the page. All I should have to do is set "position: fixed" to the header, which I currently have. For some reason, it's treating it more…
Andrew
  • 1,121
  • 4
  • 15
  • 24
39
votes
1 answer

Android: Detecting When ScrollView Hits Bottom

Possible Duplicate: How to trigger an event when scrollView reach the bottom with Android? I have been trying for an hour or so to detect when my scrollView gets to the bottom of the screen. Due to the various screen sizes and what not involved…
Peacecraft
  • 443
  • 1
  • 5
  • 6
39
votes
3 answers

angularJS - getting x & y positions from mouseclick in div

I made a function that should add an item on the position I clicked inside a div. Now the problem with this function is, every time I click, it takes the x & y position of the document, not the x & y position inside the div. So what I actually want,…
mwinter
  • 596
  • 2
  • 5
  • 14
38
votes
9 answers

Position of navigation bar for modal view - iOS7

In a navigation controller, you automatically get the correct colour and position of a navigation bar as expected. like this But in modal view, when you drag in a navigation bar, you can position it right at the top, which is too close to the…
DogCoffee
  • 19,820
  • 10
  • 87
  • 120
36
votes
2 answers

Position legend in first plot of facet

I would like to put my plot legend inside the plot, inside the first plot of a facet. Here is some example code: df=data.frame( x=runif(10), y=runif(10), facet=rep(c("a","b"),5), …
jslefche
  • 4,379
  • 7
  • 39
  • 50
36
votes
6 answers

scrollTop jQuery, scrolling to div with id?

So this is the current code I have $(document).ready(function() { $('.abouta').click(function(){ $('html, body').animate({scrollTop:308}, 'slow'); return false; }); $('.portfolioa').click(function(){ $('html,…
Jake
  • 1,137
  • 3
  • 11
  • 14
36
votes
3 answers

Extend div to bottom of page (only HTML and CSS)

Its a very simple problem but I can't seem to find a suitable solution online. I want to have a list of elements in natural flow with the last element extended to the bottom of the page. So if I have
woojoo666
  • 7,801
  • 7
  • 45
  • 57
36
votes
1 answer

How to jitter text to avoid overlap in a ggplot2 scatterplot?

I would like to create a clean version of a scatterplot of text labels in ggplot2. The goal is to represent visually the increasing values associated with about 25 items. I am already using "position_jitter," but I wonder if I can do better. Here is…
user1257313
  • 1,057
  • 4
  • 11
  • 10
36
votes
2 answers

CSS - Link not clickable when using absolute position

Here is the HTML script of my header:
34
votes
9 answers

Margin-right broken on width 100%

I have a DIV containing an image and a second DIV. The parent DIV is set to position: absolute; the child DIV is set to position: relative. The idea is that I display my photo caption on top of my image. The child DIV should have 100% width of the…
Olly F
  • 2,729
  • 9
  • 31
  • 35