Search Results

Search found 10662 results on 427 pages for 'cursor position'.

Page 39/427 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • retrieve Scrollbar position with javascript

    - by Paul
    I know how to do this in flash, but completely lost about regular html. I'm trying to detect the position of the browser scrollbar with Javascript to decide where abouts in the page the current view is. My guess is that I'd have to detect where the thumb on the track is, and then the height of the thumb as a percentage of the total height of the track. Am I over-complicating it, or does Javascript offer an easier solution than that? Any ideas code-wise. Thanks.

    Read the article

  • Java iText Image position

    - by skowron-line
    I have: Image i = Image.getInstance("tabelka.png"); i.scalePercent(25, 25); for(int i=0; i<= 5; i++) { doc.add(i); content.moveTo(50, ??);////// <-------------- HOW TO CHECK THE Y POSITION content.showText("skowron-line"); } I want to set text on upper right corner of image. How do I do that? EIDT: After hours of thinkin i found dirty solution: Image img = Image.getInstance("tabelka.png"); img.scalePercent(25, 25); float start = x; for(int i =1; i<= 5; i++) { start = (x - (img.getHeight() * 0.25f) * i); } If U know better solution let me know.

    Read the article

  • jQuery offset combined with jQuery UI doesn't update on drag

    - by Constructor
    I need to get the offset of the element that is being dragged and I use: $(function(){ $(".draggable").draggable({ stop: function(){ var offset = $("#boxone").offset(); alert(offset.left); } }); }); the element is positioned absolute and has a CSS of: left:100px; that is the value I get on the alert when I drag the element (even multiple times). What I want is to get it to alert the current offset (if I drag in 200px to the right it should say 300)

    Read the article

  • Exception throws There is no row at position 0

    - by Nimantha Prasad
    I wanted to check user is valid or not.it gives me the exception,When user valid it's working without issue,But if user invalid there's some issue. Exception is : There is no row at position 0 Here is the part of the code, public bool CheckUserExistAndReporter(string user) { int reporterDnnId = -1; SMSFunctionController mysms = new SMSFunctionController(); DataSet uds = mysms.GetUsersUnitByUserName(user); reporterDnnId = Convert.ToInt32(uds.Tables[0].Rows[0]["DnnUserID"]); if (reporterDnnId > 0) { bool isValidUser = true; return isValidUser; } //else //{ //bool isValidUser =false; //return isValidUser; // } return false; } Then i call thatone here. if (!CheckUserExistAndReporter(user)) { ErrorLog(messageIn); msgOut = "ugyldig Bruker";//Invalid User. } what is the error ?

    Read the article

  • C# - opening process and changig window position

    - by bartq
    I want to open from c# an application (standalone flashplayer) and set it position to (0,0) on the screen. How can I do this? So far I've managed to open flashplayer: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace swflauncher { class Program { static void Main(string[] args) { Process flash = new Process(); flash.StartInfo.WindowStyle = ProcessWindowStyle.Normal; flash.StartInfo.FileName = "D:\\development\\flex4\\runtimes\\player\\10\\win\\FlashPlayer.exe"; flash.Start(); } } }

    Read the article

  • Div that follows scroll (not position:fixed)

    - by Ricardo Mustra
    I found it sometime ago and now I can't. I want to find something like the shopping cart at the apple store, it's a div thats not positioned absolute nor fixed, for instance, let's say it's at the center of the screen, and only when you scroll down it follows the scroll only to not disappear, when it reaches the border of the browser header... I'm not sure If i'm being clear. I've searched but all I found is the css position fixed stuff. Can you help me with a link or something? Best Regards

    Read the article

  • How to change the position of a imageButton when onClick

    - by Amber
    I am trying to shift the position of a image button when on click. I tried the following but it crashes at "rlOut.addView(imgP, p);" I have no issues when running them in onCreate(). RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(62, 62); ImageButton imgP = (ImageButton)findViewById(R.id.imgP); public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub LayoutParams par = (LayoutParams)imbBtn.getLayoutParams(); if(event.getAction()==MotionEvent.ACTION_DOWN) { Log.d("ok","down"); mX = (int) event.getX() - imbBtn.getWidth() / 2; mY = (int) event.getY() - imbBtn.getHeight() / 2; et1.setText("mX down: "+String.valueOf(mX)); et2.setText("mY down: "+String.valueOf(mY)); } else if (event.getAction()==MotionEvent.ACTION_UP) { Log.d("ok","up"); p.leftMargin=mX; p.rightMargin=mY; rlOut.addView(imgP, p); Log.d("ok","p"); }

    Read the article

  • parsing position files in ruby

    - by john
    I have a sample position file like below. 789754654 COLORA SOMETHING1 19370119FYY076 2342423234SS323423 742784897 COLORB SOMETHING2 20060722FYY076 2342342342SDFSD3423 I am interested in positions 54-61 (4th column). I want to change the date to be a different format. So final outcome will be: 789754654 COLORA SOMETHING1 01191937FYY076 2342423234SS323423 742784897 COLORB SOMETHING2 07222006FYY076 2342342342SDFSD3423 The columns are seperated by spaces not tabs. And the final file should have exact number of spaces as the original file....only thing changing should be the date format. How can I do this? I wrote a script but it will lose the original spaces and positioning will be messed up. file.each_line do |line| dob = line.split(" ") puts dob[3] #got the date. change its format 5.times { puts "**" } end Can anyone suggest a better strategy so that positioning in the original file remains the same?

    Read the article

  • Would this predicate work ? this came on my quiz to find the position of element X in a data structure called list

    - by M.K
    example: position(1,list(1,list(2,nil)),Z). Z = 1. position(3,list(1,list(2,list(3,nil)),Z). Z = 3. where Z is the position of element X in a data structure of a list in the above format Here was my solution: position(X,list(nil),0). %empty list position(X,list(X,T),1). %list with X as head or first element position(X,list(H,T),Z):- position(X,list(T,nil),Z1), %X is in tail of list (H,T) Z is Z1 + 1.

    Read the article

  • ActionScript - Automatic containment and repositioning of object bounds

    - by TheDarkIn1978
    when adding objects arbitrarily to the stage with mouse clicks, is there a more simple way to making sure the object's bounds do not exceed those of the stage? currently i'm calling something like this before adding the object to the display list: var newSwatchRect:Rectangle = newSwatch.getBounds(this); if (newSwatchRect.x < stage.x) {newSwatchRect.x = stage.x;} if (newSwatchRect.y < stage.y) {newSwatchRect.y = stage.y;} if (newSwatchRect.x + newSwatchRect.width > stage.stageWidth) {newSwatchRect.x = stage.stageWidth - newSwatchRect.width;} if (newSwatchRect.y + newSwatchRect.height > stage.stageHeight) {newSwatchRect.y = stage.stageHeight - newSwatchRect.height;}

    Read the article

  • movedown method not saving new position - cakephp tree

    - by Ryan
    Hi everyone, I am experiencing a problem that has popped up recently and is causing quite a bit of trouble for our system. The app we have relies on using the movedown method to organize content, but as of late it has stopped working and began to generate the following warning: Warning (2): array_values() [<a href='function.array-values'>function.array-values</a>]: The argument should be an array in [/usr/local/home/cake/cake_0_2_9/cake/libs/model/behaviors/tree.php, line 459] The line being referenced: list($node) = array_values($Model->find('first', array( 'conditions' => array($scope, $Model->escapeField() => $id), 'fields' => array($Model->primaryKey, $left, $right, $parent), 'recursive' => $recursive ))); The line calling the method: $this->movedown($id,abs((int)$position)); I have exhausted every idea I could come up with. Has anyone else crossed this issue before? Any help, or pointing in a direction would be much appreciated!

    Read the article

  • Retrieving Gtk::Widget's relative position: get_allocate() doesn't work

    - by a-v
    I need to retrieve the position of a Gtk::Widget relative to its parent, a Gtk::Table. Most sources (e.g. http://library.gnome.org/devel/gtk-faq/stable/x642.html) say that one needs to call Gtk::Widget::get_allocation(). However, the returned Gtk::Allocation object always contains x = -1, y = -1, width = 1, height = 1. I have to note that this happens before the Gtk::Table object is actually exposed and rendered. A call to show_all_children() or check_resize(), which I would expect to recalculate child widget geometry, doesn't help. What am I doing wrong? Thanks in advance.

    Read the article

  • C# - opening process and changing window position

    - by bartq
    I want to open from c# an application (standalone flashplayer) and set it position to (0,0) on the screen. How can I do this? So far I've managed to open flashplayer: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace swflauncher { class Program { static void Main(string[] args) { Process flash = new Process(); flash.StartInfo.WindowStyle = ProcessWindowStyle.Normal; flash.StartInfo.FileName = "D:\\development\\flex4\\runtimes\\player\\10\\win\\FlashPlayer.exe"; flash.Start(); } } }

    Read the article

  • Animate/Ease an element to position when other elements disappear

    - by Jonathan
    Please take a look at this fiddle: http://jsfiddle.net/dhcyA/ Try clicking on a block. What I want is that when the other elements disapear, the selected block will animate/ease to his giving position instead of just jumping like it does now. Then the same animation repeats itself when clicking again on the box, but then back to place. Maybe to keep in mind: I'm using a reponsive design, which means those blocks can be vertical and horizontal after scaling the window. Any redevisions on the fiddle or suggustions would be great!

    Read the article

  • Solving the magical footer issue

    - by MasterLee
    If you have a quick look at this website that I am designing: http://miladalami.com The blackline seen in the footer is the one that I want to fix. Is there anyway that I can put that footer at the bottom of the content (wrapper) of the page? I have not done any webdesigning since the golden days of tables so CSS is quite new to me. Anyone that could assist this old man? Please be specific in any reply as I am new to CSS styling...

    Read the article

  • centering image in div

    - by Harsh Reddy
    I have a square <div> (70px x 70px) which will contain an image of a variable dimensions(Square, landscape or potrait). I want this image to be symmetrically centered inside the <div>. how do I get it..? <div class="img-polaroid" style="width: 70px; height: 70px; background-color: black; text-align:center;"> <image src='.base_url("images/store/images/".$image->image).' /> </div> The actual size of the image can be greater than 70px x 70px. But it should fit symmetrically in the center. I also have to make it cross-browser compatible.. Help Appreciated...

    Read the article

  • SQL Server 2005 - query with case statement

    - by user329266
    Trying to put a single query together to be used eventually in a SQL Server 2005 report. I need to: Pull in all distinct records for values in the "eventid" column for a time frame - this seems to work. For each eventid referenced above, I need to search for all instances of the same eventid to see if there is another record with TaskName like 'review1%'. Again, this seems to work. This is where things get complicated: For each record where TaskName is like review1, I need to see if another record exists with the same eventid and where TaskName='End'. Utimately, I need a count of how many records have TaskName like 'review1%', and then how many have TaskName like 'review1%' AND TaskName='End'. I would think this could be accomplished by setting a new value for each record, and for the eventid, if a record exists with TaskName='End', set to 1, and if not, set to 0. The query below seems to accomplish item #1 above: SELECT eventid, TimeStamp, TaskName, filepath FROM (SELECT eventid, TimeStamp, filepath, TaskName, ROW_NUMBER() OVER(PARTITION BY eventid ORDER BY TimeStamp DESC) AS seq FROM eventrecords where ((TimeStamp >= '2010-4-1 00:00:00.000') and (TimeStamp <= '2010-4-21 00:00:00.000'))) AS T WHERE seq = 1 order by eventid And the query below seems to accomplish #2: SELECT eventid, TimeStamp, TaskName, filepath FROM (SELECT eventid, TimeStamp, filepath, TaskName, ROW_NUMBER() OVER(PARTITION BY eventid ORDER BY TimeStamp DESC) AS seq FROM eventrecords where ((TimeStamp >= '2010-4-1 00:00:00.000') and (TimeStamp <= '2010-4-21 00:00:00.000')) and TaskName like 'Review1%') AS T WHERE seq = 1 order by eventid This will bring back the eventid's that also have a TaskName='End': SELECT eventid, TimeStamp, TaskName, filepath FROM (SELECT eventid, TimeStamp, filepath, TaskName, ROW_NUMBER() OVER(PARTITION BY eventid ORDER BY TimeStamp DESC) AS seq FROM eventrecords where ((TimeStamp >= '2010-4-1 00:00:00.000') and (TimeStamp <= '2010-4-21 00:00:00.000')) and TaskName like 'Review1%') AS T WHERE seq = 1 and eventid in (Select eventid from eventrecords where TaskName = 'End') order by eventid So I've tried the following to TRY to accomplish #3: SELECT eventid, TimeStamp, TaskName, filepath FROM (SELECT eventid, TimeStamp, filepath, TaskName, ROW_NUMBER() OVER(PARTITION BY eventid ORDER BY TimeStamp DESC) AS seq FROM eventrecords where ((TimeStamp >= '2010-4-1 00:00:00.000') and (TimeStamp <= '2010-4-21 00:00:00.000')) and TaskName like 'Review1%') AS T WHERE seq = 1 and case when (eventid in (Select eventid from eventrecords where TaskName = 'End') then 1 else 0) as bit end order by eventid When I try to run this, I get: "Incorrect syntax near the keyword 'then'." Not sure what I'm doing wrong. Haven't seen any examples anywhere quite like this. I should mention that eventrecords has a primary key, but it doesn't seem to help anything when I include it, and I am not permitted to change the table. (ugh) I've received one suggestion to use a cursor and temporary table, but am not sure how badley that would bog down performance when the report is running. Thanks in advance.

    Read the article

  • Advice on software / database design to avoid using cursors when updating database

    - by Remnant
    I have a database that logs when an employee has attended a course and when they are next due to attend the course (courses tend to be annual). As an example, the following employee attended course '1' on 1st Jan 2010 and, as the course is annual, is due to attend next on the 1st Jan 2011. As today is 20th May 2010 the course status reads as 'Complete' i.e. they have done the course and do not need to do it again until next year: EmployeeID CourseID AttendanceDate DueDate Status 123456 1 01/01/2010 01/01/2011 Complete In terms of the DueDate I calculate this in SQL when I update the employee's record e.g. DueDate = AttendanceDate + CourseFrequency (I pull course frequency this from a separate table). In my web based app (asp.net mvc) I pull back this data for all employees and display it in a grid like format for HR managers to review. This allows HR to work out who needs to go on courses. The issue I have is as follows. Taking the example above, suppose today is 2nd Jan 2011. In this case, employee 123456 is now overdue for the course and I would like to set the Status to Incomplete so that the HR manager can see that they need to action this i.e. get employee on the course. I could build a trigger in the database to run overnight to update the Status field for all employees based on the current date. From what I have read I would need to use cursors to loop over each row to amend the status and this is considered bad practice / inefficient or at least something to avoid if you can??? Alternatively, I could compute the Status in my C# code after I have pulled back the data from the database and before I display it on screen. The issue with this is that the Status in the database would not necessarily match what is shown on screen which just feels plain wrong to me. Does anybody have any advice on the best practice approach to such an issue? It helps, if I did use a cursor I doubt I would be looping over more than 1000 records at any given time. Maybe this is such small volume that using cursors is okay?

    Read the article

  • How can I find a position between 4 vertices in a fragment shader?

    - by c4sh
    I'm creating a shader with SharpDX (DirectX11 in C#) that takes a segment (2 points) from the output of a Vertex Shader and then passes them to a Geometry Shader, which converts this line into a rectangle (4 points) and assigns the four corners a texture coordinate. After that I want a Fragment Shader (which recieves the interpolated position and the interpolated texture coordinates) that checks the depth at the "spine of the rectangle" (that is, in the line that passes through the middle of the rectangle. The problem is I don't know how to extract the position of the corresponding fragment at the spine of the rectangle. This happens because I have the texture coordinates interpolated, but I don't know how to use them to get the fragment I want, because the coordinate system of a) the texture and b) the position of my fragment in screen space are not the same. Thanks a lot for any help.

    Read the article

  • Unity3D: How To Smoothly Switch From One Camera To Another

    - by www.Sillitoy.com
    The Question is basically self explanatory. I have a scene with many cameras and I'd like to smoothly switch from one to another. I am not looking for a cross fade effect but more to a camera moving and rotating the view in order to reach the next camera point of view and so on. To this end I have tried the following code: firstCamera.transform.position.x = Mathf.Lerp(firstCamera.transform.position.x, nextCamer.transform.position.x,Time.deltaTime*smooth); firstCamera.transform.position.y = Mathf.Lerp(firstCamera.transform.position.y, nextCamera.transform.position.y,Time.deltaTime*smooth); firstCamera.transform.position.z = Mathf.Lerp(firstCamera.transform.position.z, nextCamera.transform.position.z,Time.deltaTime*smooth); firstCamera.transform.rotation.x = Mathf.Lerp(firstCamera.transform.rotation.x, nextCamera.transform.rotation.x,Time.deltaTime*smooth); firstCamera.transform.rotation.z = Mathf.Lerp(firstCamera.transform.rotation.z, nextCamera.transform.rotation.z,Time.deltaTime*smooth); firstCamera.transform.rotation.y = Mathf.Lerp(firstCamera.transform.rotation.y, nextCamera.transform.rotation.y,Time.deltaTime*smooth); But the result is actually not that good.

    Read the article

  • iPhone: image in table cell - wrong position & not scaled correctly in iPhone 3.0

    - by Karsten Silz
    Hi, I have a custom table cell in an iPhone 3.x app to show basketball player data, including a picture. Here's my code from the table controller: UIImageView *theImage = (UIImageView *) [cell viewWithTag:0]; theImage.image = [manager getSmallImageForPlayer: data.number]; theImage.frame = CGRectMake(14, 0, 30, 44); theImage.clipsToBounds = YES; theImage.contentMode = UIViewContentModeScaleAspectFit; theImage.autoresizingMask = UIViewAutoresizingFlexibleHeight && UIViewAutoresizingFlexibleWidth; theImage.autoresizesSubviews = YES; Here's what it looks like in the iPhone SDK 3.0 simulator: Here's what it looks like in the iPhone SDK 3.1.3 simulator: So I have two problems: In both versions, the image view starts at position (0,0) in the table cell, even though I set the frame to start at (14,0). In the 3.0 simulator (and 3.0 device), the image is not shrunk down correctly, even though I set the image view content mode to "UIViewContentModeScaleAspectFit". But the same code works fine in the 3.1.3 simulator / device. Who can help me with either of these two problems?

    Read the article

  • Synchronize the position of two ScrollView views

    - by Billy
    I am trying to synchronize the positions of two ScrollViews. I'm trying to do this to display a tv guide listing. I have created a custom class that extends RelativeLayout to display the guide. This relative layout has four children: an imageview in the top left corner, a HorizontalScrollView to display the column headers in the top right, a ScrollView to display the row headers at the bottom left, and a ScrollView in the bottom right that contains the listings. This ScrollView then contains a HorizontalScrollView, which in turn contains a LinearLayout with multiple child views that display the data. I hope this explains it clearly, but here's a diagram to make it clearer: ____________ |__|___hsv___| | | | | | sv -> | | | hsv -> | |sv| ll -> | | | etc | | | | |__|_________| I set it up like this because I wanted the guide listings to scroll both horizontally and vertically, but there's no scroll view that does this. Also, I want the row and column headers to display no matter what position the guide listings are at, but I want them to be lined up properly. So I'm trying to find a way to synchronize the positions of the two hsv's, and to also synchronize the positions of the two sv's. I'm also trying to do it in a way that avoids just running a handler every few milliseconds to poll one view and call scrollTo on the other. I'm in no way sure that this is the best way to do it, but this is what I've come up with. If anybody has any other suggestions, please feel free!

    Read the article

  • Scroll Position in a Table Body

    - by Craig Walker
    I want to implement infinite scrolling (with an AJAX-based loader) in an HTML table body. My HTML looks something like this: <table> <thead> <tr><th>Column</th></tr> </thead> <tbody> <tr><td>Row 1</td></tr> <tr><td>Row 2</td></tr> </tbody> </table> I get a scroll bar on the <tbody> like so: tbody { height:10em; /* Otherwise the tbody expands to fit all rows */ overflow:auto; } To be able to do anything when the user scrolls to the bottom, I need to be able to get the scroll position of the <tbody>. In all of the (jQuery) infinite scroll implementations I've seen (such as this one), they subtract the content height from the container height and compare it to the .scrollTop() value. Unfortunately this may not work with <tbody>, which is both the viewport and the container for the scrolled content. $("tbody").height() returns the viewable (ie: "shrunken") size, but I don't know how I can get the full (viewable + hidden) size of the table body. (FWIW, $("tbody").scrollTop() returns a "large" number when scrolled to the bottom, exactly as I would expect it to). Is there any way to accomplish this?

    Read the article

  • Silverlight 3 - Data Binding Position of a rectangle on a canvas

    - by Blounty
    Hi Everyone, I am currently trying to bind a collection of objects to a Canvas in Silverlight 3 using an ItemsControl as below: <ItemsControl x:Name="ctrl" ItemsSource="{Binding myObjectsCollection}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas></Canvas> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Rectangle Stroke="LightGray" Fill="Black" StrokeThickness="2" RadiusX="15" RadiusY="15" Canvas.Left="{Binding XAxis}" Height="25" Width="25"> </Rectangle> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> Unfortunately it seems the binding on the Canvas.Left is being ignored. From what i have learned here it would appear this is due to the items being placed inside a content presenter not the actual canvas i have specified in the items panel. Is there a way i can use data binding to determine the position of elements on a canvas?

    Read the article

  • Textbox autofill not in correct position in safari

    - by jerjer
    Hello All, Has anyone experience this weird issue on safari? Textbox autofill is not at its correct position, please see screenshot below. I have been searching for answers in google for almost a day, still no luck. This is the built-in autofill feature of safari. Here is the markup: index.php <html> <body> <div id="nav"></div> <div id="content"> <iframe style="width:100%;height:100%" src="add_user.php" frameborder="0"></iframe> </div> .... </body> </html> add_user.php <html> .... <body> <form method="post"> <h3>Add User (Admin only) <div id="msg">Please enter First and Last Name.</div> <ul> <li><label>* Email</label> <input type="text" id="email" /></li> <li><label>* First Name</label> <input type="text" id="fname" /></li> <li><label>* Last Name</label> <input type="text" id="lname" /></li> .... </ul> </form> </body> </html> I am suspecting that this is caused by the iframe, but it works just fine in other browsers. Also I could not change the page design(using iframe) right away for practical reasons. Thanks

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >