position

onMouseMove get mouse position

In javascript, within the javascript event hander for onMouseMove how do I get the mouse position in x, y corrdinates relative to the top of the page? ...

How do you return draggable content to their original positions in iPhone dev?

I am wanting to create a button in my iPhone app that when touched will return other draggable elements to their original position. I have looked at the Apple "MoveMe' example, but that returns the button to the center of the screen. I want to be able to position draggable objects around the screen, drag the objects within the app, and...

fgets in c doesn't return a portion of an string

Hi! I'm totally new in C, and I'm trying to do a little application that searches a string into a file, my problem is that I need to open a big file (more than 1GB) with just one line inside and fgets return me the entire file (I'm doing test with a 10KB file). actually this is my code: #include <stdio.h> #include <string.h> int mai...

How to get the start and end points of selection in text area?

i want to get the cursor start and end position of a selected range in a text-field or text-area. i tried lot of functions in various forums. but when the last character of the selection is a new line character JavaScript ignore it in IE6. any one having idea ? ...

javascript: how to determine initial mouse position?

hi. how can i determine the initial mouse position? right now i use onmousemove, but that sometimes only fires when the mouse is actually moved. same with onmouseover. if i dont move the mouse, i observed the following: it seems like in IE a mousemove event is always fired right at the beginning, in firefox never, and in chrome strang...

Locking the mouse position.

Hi guys, I have to resort to you again. Is there a way to lock the mouse X and Y position?, I mean, I want to move my mouse but I want that the mouse position to be locked on.. let say, the center of the screen. Btw, I need to do this using Flash. If there is ANY workaround, i.e, using JS or something like that, would be appreciated. ...

Showing SelectedItem Details to its side

I've a ListView bound to an ObservableCollection<Foo>. On selecting a ListViewItem I display the details of the SelectedItem(Foo members) in a container. It works fine. Now all I want is to display the details just next to the SelectedItem. ie, If I select the fourth ListViewItem then the Container's Top should be the same as the ListVi...

Adjust Footer based on content.

Hi, I am using this site. Aim : I want to move my footer based on the content of every page. 1)If there is more content then i want to put my footer after the content. 2)I want to fix the footer to the bottom of the window screen, if there is no content like this in the following picture My existing CSS : I am currently using min-he...

Javascript: Hide Popup With Cordinates

Hi all! My problem: For example: I have a link, when I click on it a popup div is shown, and when I click on the link again then closes the popup, that's ok, but how can I do to close the opened popup box when I click anywhere else outside of the popup. I've searched a lot and I found some solutions, but those weren't enough good to me...

Position of first word of string in Javascript

I originally used indexOf to find a space but I want to find any word boundary. Something like this, but what regex? var str = "This is a sentence", firstword = str.search(""); return word; I want to return "This". Even in the case of a tab, period, comma, etc. ...

[JQuery] - How to find out position of clicked element?

How do I find out, in what position a list item was clicked. So, let's say I clicked the second list item: <li><a href="#"><span>Tab 2</span></a></li> Then, I would get an alert saying something like: You clicked the second list item? JQuery Code $('#top-betting ul li:first').addClass('current'); $('#top-betting div:not(:first)'...

How to set the position of a AlertDialog off the screen at top in Android ?

Hi, I want to set the AlertDialog position behind the status bar, when the content in my Dialog will increase, How to do that? I am creating a custom AlertDialog using my own layout.... Please help me out.... ...

How to make a design "loose coupling"?

I'm making a simple 3D CAD software. in the class diagram, many objects need to distinguish with others by (x,y,z). I create a class so-called "Position", but the problem is it looks highly-coupling because many classese work with position. Any ideas? ...

Creating a collapsed range from a pixel position in FF/Webkit

Using JavaScript, I would like to create a collapsed range from a pixel position, in order to insert new nodes in the flow of the document, after the range identified by this position. This can be done with the TextRange object in Internet Exporer (moveToPoint(x, y) method). How can I do this in FireFox & Webkit? I can get the contain...

Simulate position:fixed in jQuery

I have a header that is larger than the width of the page so that I can't use position:fixed to set him on top of the page, because I absolutely need to be able to scroll horizontally. I don't think there is a CSS solution for this. I made a sample of code to try to reproduce the effect of position:fixed, but there are undesired jumps. ...

can I override z-index inheritance from parent element?

is there anyway to override z-index inheritance from parent elements when using absolute position. I want 2222 div to be on top of 0000 div <div style="background-color:green; z-index:10; position:relative">OOOO</div> <div style="background-color:yellow; z-index:5; position:relative">1111<div style="position:absolute; background-color:...

C# GetType().GetField at an array position

public string[] tName = new string[]{"Whatever","Doesntmatter"}; string vBob = "Something"; string[] tVars = new string[]{"tName[0]","vBob","tName[1]"}; Now, I want to change the value of tName[0], but it doesnt work with: for(int i = 0; i < tVars.Lenght;++i) { this.GetType().GetField("tVars[0]").SetValue(this, ValuesThatComeFromS...

css float/positioniong

So I have a small div for the border, and three divs inside (see image at end). Green is full size (minus padding etc); Blue should float left and have specific width; Red should float right and also have a specific width. However I'm messing something up. Both of the blue and red divs float outside the main div. What am I doing wrong he...

How to keep background image on bottom left even scrolling....

Hello. I was wondering if there is a way to keep my background image on bottom left all the time even if the user scroll the browser. My current css can make the image in the bottom of the browser when the site loaded, but if I scroll the browser, it will still stay in the same location. I appreciate any help. html, body { backgroun...

How to set position of toolbar in jqGrid?

Hello! I need to set the position of search toolbar to top in jqGrid. How can I do it? Thanks. ...