position

find top and last element inside a scrollable div

I have a scrollable div with a fixed height. While scrolling I need to get the element at the top of the visible viewport and the one at the bottom of the viewport. I can get the position of the scrollbar using scrollTop, however I am not sure how to get the element. Update: Formatted question for clarity. ...

openGL position and orientation from modelview matrix

Hello! My problem is the following: I have nested object in my opengl scene, and i only know their relative position and orientation. How do I get the absolute position and orientation of the inner object? I' thinking of calculating the modelview matrix of the inner object, and after that i have the current matrix, but how do i conver...

Get position of element by javascript

I've seen a dozen of script that can catch the x and y position of an element/object within the page. But i am always having trouble with catching the x and y when the webpage is using margins at the body, or other elements, absolute/relative elements, such like that. Is there a solution wich provides the exact position, no matter what ...

WPF: Default TabControl's active tab overlaps from it's container, how to replicate this?

Hi, I am subclassing a control from TabControl (to be able to add stuff alongside tabs, like modern browsers do), and I encountered this problem: The active tab of native TabControl (1st and 2nd control from the top in the picture) overlaps the border of ContentPresenter, hiding the thin line underneath. I copied the xaml from Aero dic...

HTML get coordinates/position on click with JS

Hello, Is there a way to get a position/coordinates on mouse click? In example if I have an image in a container and I click on it I want to get coordinates(x,y) in that image? I see only 1 solution to make lots of containers on top of image so small(will be like grid) that when I click it will give containers position in js, but I thin...

JavaScript Mouse position over an element (code not working)

Hello, I want to display the mouse position when its inside an element.. heres the code: Mouse Events Example function GetMousePositionInElement(ev, element) { var osx = element.offsetX; var osy = element.offsetY; var bottom = osy + element.height(); var x...

One Table and several divs position

Have table and several div elements. Table is time grid and divs are events that may take every position relatively table from top to bottom, dependently on time. See screenshot: So to make margin-top for div correct I specify it as negative, because these divs are positioned relatively to the table. But in some cases they positioned...

Make a relative-positioned block element the same size as its contained absolute-positioned element

Ok, I'm trying to take several divs and all their content, and stack them on top of each other and make the containing div (#stack) appear in the normal flow of things via the following method: CSS: #stack { position:relative; display:block; } #stack div { position:absolute; left:0; } HTML: <div id="stack"> <div>...

Display the 'right' style of a div with JQuery

I'm trying to display the "right" value of a div named "slider", displaying it inside of "span.display_value" var rightStyleValue = $('div.slider').css('right'); alert(rightStyleValue); $('.display_value').html(rightStyleValue); UPDATE: Html is posted below. I'm using a drag and drop script to drag a div called "slider" that...

Div overlapping in Firefox

Hi, Please see the html below it works fine in IE, but in Firefox it overlaps..please try and give me solution. When the position of the div inside the td was given static, it's working properly.But i need absolute there since i need to use the left and top attributes.Any help is appreciated.Thanks <table style="height:auto; positi...

how can we get x-y-z parameters from webcam via matlab?

Hi There, I am using web-camera to capture real-time image via matlab, and succeeded to preview the video using simple videoinput, getsnapshot, and preview functions. To be honest, I am not really satisfied with the result though, because the view-angle is still too wide and I can not set the position of my webcam manually, means I ca...

Text Wrapping around an absolute positioned div.

I know there are a few questions about similar topics but they mostly amount to floating the div/image. I need to have the image(and div) positioned absolutely (off to the right) but I simply want the text flow around it. It works if I float the div but then I can't position it where I want. As it is the text just flows behind the pictur...

using MDX Sprite.Draw2D() and the positional problems i have encountered. [Fixed]

I'm trying to use the Sprite Class in Microsoft.DirectX.Direct3D to draw some sprites to my device. GameObject go = gameDevice.Objects[x]; SpriteDraw.Draw2D(go.ObjectTexture, go.CenterPoint, go.DegreeToRadian(go.Rotation), go.Position, Color.White); GameObject is a class i wrote, in which all the basic information required of a game o...

How to set css position absolute for Firefox and Chrome and relative for IE

Hi y'all... What is the IE hack for setting the position property : relative in "not-a-browser"IE and position : absolute in other browsers (FireFox, Chrome).. Thanks everyone..!!! ...

How can I split a table vertically into two tables in XSL?

If I have the following table: <table> <tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr> <tr><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td></tr> </table> How would I split this in XSLT so that I end up with the following: <table> <tr><td>1</td><td>2</td><td>3</td></tr> <tr><td>A</td><td>B...

Question about position relative DIVS

I always see code like this: #container { background:#000000 none repeat scroll 0 0; display:block; overflow:hidden; position:relative; width:100%; } I thought position relative is used to accommodate the div relatively to its parent element using the CSS proprieties left right top and bottom (px). What's t...

Relative positioning + Absolute positioning VS Floats Left an Float Right (Which approach do you use in your CSS)?

Some websites use a DIV with relative position and then they apply absolute position to the child element in order to place the element in the desired position (e.g. left 0 or right 0). Others use floats, for instance float: left or float right. Which one is better? or in what kind situations they are better? Since I use fixed layouts,...

How to have a simple sticky position article list in a MySQL database that can be retrieved with only one query?

I have a paginated list of articles that needs to be sorted by rank but when an article has position <> 0 then it must be inserted in that specific position. I thought that I can at least have the articles with the correct position extracted for the current page and then sort them in PHP to show then in the proper position. I want to do ...

CSS IE6 IE7 Set child element's width when parent element's position is relative.

I'm trying to set a width for a child element which parent's position is relative. But when I give a width to child larger than parent's width, the parent's width in FireFox will be changed. And which in IE6/IE7, I must change the parent's width then the child's can be changed. Now, I need to change the child's width but not change it's ...

IE and absolute positioning divs

This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;'> Put more than a full screen of text in here. It should create a scroll inside the div. In IE, it stretches the div out vertically. </div> </body> </html> If you put a ton of...