Search Results

Search found 3309 results on 133 pages for 'relative positioning'.

Page 16/133 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • relative path issue (noob)

    - by tim roberts
    I am using the following code to check existence of a file before publishing an image in my erb file. <% @imagename = @place.name + ".jpg" %> <% if FileTest.exist?( "/Users/Tim/projects/game/public/" + @imagename ) %> <p><img src= '<%= @imagename %>' width="400" height="300" /> </p> <% end %> And when I publish this to Heroku, it obviously wont work. I tried using a relative path, but not able to get it to work. <% if FileTest.exist?( "/" + @imagename ) % any help appreciated.

    Read the article

  • Adding relative week number column to MySQl results

    - by Anthony
    I have a table with 3 columns: user, value, and date. The main query returns the values for a specific user based on a date range: SELECT date, value FROM values WHERE user = '$user' AND date BETWEEN $start AND $end What I would like is for the results to also have a column indicating the week number relative to the date range. So if the date range is 1/1/2010 - 1/20/2010, then any results from the first Sun - Sat of that range are week 1, the next Sun - Sat are week 2, etc. If the date range starts on a Saturday, then only results from that one day would be week 1. If the date range starts on Thursday but the first result is on the following Monday, it would be week 2, and there are no week 1 results. Is this something fairly simple to add to the query? The only ideas I can come up with would be based on the week number for the year or the week number based on the results themselves (where in that second example above, the first result always gets week 1).

    Read the article

  • block z-positioning without z-index

    - by Peter
    Please, have a look at: http://twitter.github.com/bootstrap/base-css.html There are many examples like this one: if you look closer to the block borders, you can see that the gray block is under the white one. Using the browser's developer tools you can see that both boxes have an inherited z-index: auto; I can't reproduce this effect on my website (without using z-index). So, my question is: Why is the gray block under the white one?

    Read the article

  • Actionscript NetStream.play drops port in relative URLs

    - by Steve Middleton
    Hi, the current page my flash application is running from is http://localhost:3000/. I'm trying to play a video using NetStream.play(relativeURL) by using a relative URL (e.g. "myVideo.flv"), but when I look at the actual request made by actionscript, it's dropping the port number. (e.g. http://localhost/myVideo.flv). Is there something I can do on the flash side to make this work? Is anyone else having this problem?

    Read the article

  • flex positioning a button within a panel

    - by pfunc
    All I'm trying to do is place a button inside of a panel, rotate that button (so it is vertical) and place it on the edge of the panel. I can;t seem to do this correctly. Here is my code: <mx:Panel id="weekList" width="260" height="100%" x="-500" title="Weeks" > <mx:List id="weekButtonList" width="260" borderVisible="false" contentBackgroundAlpha="0" dataProvider="{_data.mappoints.week.@number}" itemClick="onWeekClick(event);" > <mx:itemRenderer> <mx:Component> <mx:Button buttonMode="true" right="20" width="260" height="50" label="Week {data}" /> </mx:Component> </mx:itemRenderer> </mx:List> <mx:HBox id="closeButtonHolder" rotation="90" width="100" > <mx:Button label="OPEN" click="weekListToggle()" /> </mx:HBox> </mx:Panel> If you look at the part of the script you will see I am trying to rotate it and move it to the left. I am just trying to move it somewhere, and nothing is working. Also, the text seems to dissapear when I rotate it on a 90% axis. Anyone know what I can do for this?

    Read the article

  • How to get image from relative URL in C#, the image cannot be in the project

    - by red-X
    I have a project where I'm loading relative image Uri's from an xml file. I'm loading the image like this: if (child.Name == "photo" && child.Attributes["href"] != null && File.Exists(child.Attributes["href"].Value)) { Image image = new Image(); image.Source = new BitmapImage(new Uri(child.Attributes["href"].Value, UriKind.RelativeOrAbsolute)); images.Add(image); } Where the "child" object is an XmlNode which could looks like this <photo name="info" href="Resources\Content\test.png"/> During debug it seemd images is filled with actual images but when I want to see them in any way it shows nothing. Weird thing is when I include the images in my project it does work, I however dont want to do that since my point for using an xml file is so that it would be lost since you'd have to rebuild the program anyway after a change.

    Read the article

  • Positioning Photos in a Grid (HTML)

    - by Daniel O'Connor
    Hey Everyone, I've been trying to code this page for a while, but my biggest problem is that I can't seem to get the photos perfectly positioned. For some reason, there is a small bottom padding in each <td>which is messing things up. Here is the table code: <table> <tr> <td rowspan="2" style="height:353px;"><img src="danoconnor/img/photography/farm.jpg" height="353" width="470" alt="Farm" /></td> <td><img src="danoconnor/img/photography/paragliding.jpg" height="190" width="254" alt="Paraglider" /></td> <td rowspan="2"><img src="danoconnor/img/photography/cristo.jpg" height="353" width="230" alt="Cristo Redentor" /></td> </tr> <tr> <td><img src="danoconnor/img/photography/u2.jpg" height="154" width="254" alt="U2 at Fordham University" /></td> </tr> </table> My question is: how can I make the photogrid look like this? Thanks!

    Read the article

  • Positioning DIV element at center of screen

    - by iSumitG
    I want to position a DIV (or a TABLE) element at the center of screen irrespective of screen size. In other words, the space left on 'top' and 'bottom' should be equal and space left on 'right' and 'left' sides should be equal. How to do it? Note: I prefer a complete CSS solution, but if is not possible without Javascript then using Javascript is also fine. I am trying the following but it is not working: <body> <div style="top:0px; border:1px solid red;"> <table border="1" align="center"> <tr height="100%"> <td height="100%" width="100%" valign="middle" align="center"> We are launching soon! </td> </tr> </table> </div> </body> Note: It is either way fine if the DIV element (or TABLE) scrolls with the website or not. Just want it to be at center when page loads.

    Read the article

  • Positioning objects in views during re-orientation in iPad

    - by Arni
    iPad Gurus: Apple wants us to support all orientations. I take that to mean that a particular layout should either rotate so that all objects are positioned relatively the same OR, if that doesn't look good, then they ought to be repositioned, OR two views ought to be designed and built. If I rely on the built-in rotation mechanism, the objects either get resized or they straddle the edge of the page in one orientation or the other, or they disappear from view altogether. I can't seem to find the right settings to get the objects to align clearly so they are seen in each orientation. Repositioning leads to a lot of if statements in the View Controller. So I don't think Apple had that in mind. I tried replacing views and even view controllers in "willRotateToInterfaceOrientation" method, but that either causes crashes or the portrait views end up in landscape unexpectedly and vv. Moreover, two view controllers means double the coding for the same view. There must be proper way to handle orientation changes, but I have searched the internet and documentation and sample code in vain for something that works. How is this done properly? Thanks!

    Read the article

  • C# textbox cursor positioning

    - by Jim
    I feel like I am just missing a simple property, but can you set the cursor to the end of a line in a textbox? private void txtNumbersOnly_KeyPress(object sender, KeyPressEventArgs e) { if (Char.IsDigit(e.KeyChar) || e.KeyChar == '\b' || e.KeyChar == '.' || e.KeyChar == '-') { TextBox t = (TextBox)sender; bool bHandled = false; _sCurrentTemp += e.KeyChar; if (_sCurrentTemp.Length > 0 && e.KeyChar == '-') { // '-' only allowed as first char bHandled = true; } if (_sCurrentTemp.StartsWith(Convert.ToString('.'))) { // add '0' in front of decimal point t.Text = string.Empty; t.Text = '0' + _sCurrentTemp; _sCurrentTemp = t.Text; bHandled = true; } e.Handled = bHandled; } After testing for '.' as first char, the cursor goes before the text that is added. So instead of "0.123", the results are "1230." without moving the cursor myself. I also apologize if this is a duplicate question.

    Read the article

  • Python ctypes: loading DLL from from a relative path

    - by Frederick
    I have a Python module, wrapper.py, that wraps a C DLL. The DLL lies in the same folder as the module. Therefore, I use the following code to load it: myDll = ctypes.CDLL("MyCDLL.dll") This works if I execute wrapper.py from its own folder. If, however, I run it from elsewhere, ctypes goes looking for DLL in the current working directory and naturally fails. My question is, is there a way by which I can specify the DLL's path relative to the wrapper instead of the current working directory? This will enable me to ship the two together and allow the user to run/import the wrapper from anywhere.

    Read the article

  • Flex 3 custom components positioning - popups

    - by ccdugga
    Hi, I have created a custom TitleWindow whcih i use as a popup. The contents of the popup are created dynamically depending on a selection a user makes from a datagrid. My problem is, my datagrid is in another custom component whcih is toward the bottom of my page so when a user clicks one of the items the popup is displayed however with half of it out of sight at the bottom of the page. Is there a way to position a popup so that it displays at the top of the page?

    Read the article

  • Fixing CSS positioning and scaling

    - by Louis
    I was contemplating writing a UI toolkit where setting the position and size of an element/widget was intuitive and powerful. Here are some examples of how it would be used (not currently implemented): ui("Panel").size(". 40").pos("0 0").attach(element); ui("Textarea").size(". %-10").pos("0 40").attach(element); ui("Panel").size(". 10").pos("0 bottom+5"); Where . means auto, % means 100% and the possibility to add pixels to percentages. Does anything like said exist (even as a jQuery plugin or something)? Somethings just aren't possible with pure CSS.

    Read the article

  • Vertical positioning of text in table cell

    - by Robert
    When I place an image followed by text in a table cell, the vertical alignment of the text shifts down compared to text in adjacent cells. I tried using a line-height CSS property, but it didn't seem to have an affect. In the following example, I need "123 Description" to be flush with "cell one." Also, there is a space between the image and "123" by default. How can I adjust that - negative margins perhaps? <html <head <style type="text/css" table { border-collapse: collapse; } td { border: thin solid; width: 10em;} /* .adjust-text { line-height: 1.3em; } */ </style </head <body <table <tbody <tr <tdcell one</td <td <img src="small-star.png" / <span class="adjust-text"123 Description</span </td </tr </tbody </table </body </html

    Read the article

  • Positioning the dialog box in the centre of the screen

    - by ame
    I have a dialog box developed in mfc for a Windows CE device and want it to occupy the entire screen. I used the following code to center my dialog box on the lcd screen of the device: CWnd* pWnd = GetDesktopWindow(); CenterWindow(pWnd); However, I still get a tiny sliver of space on the left side of the dialog box, resizing the dialog merely makes it overflow on the right side of the LCD while the tiny space on the left remains (I can see the blue of the win CE desktop behind.) Are there any suggestions to solve this problem? I checked the margin settings for this dialog box in my .rc files and leftmargin and topmargin are both set to 0. I was wondering if I could get the coordinates of the centre of the screen and then place my window one or two points to the left to deal with the current offset. A messy approach I know!

    Read the article

  • Positioning a Comment Input Field

    - by John
    Hello, What is a good way to give the input field below the three characteristics listed? Characteristics: -Always 30 px from the left side of the browser window. -Always 30 px below the words "Add a comment" if no comments have been added. -Always 30 px below the preceding comment if one or more comment has been added. Thanks in advance, John HTML / PHP Code: <div class="addacomment"><label for="title">Add a comment:</label></div> <div class="commentbox"><input class="commentsubfield" name="title" type="title" id="title" maxlength="1000"></div> CSS (thusfar I have no declarations for the "commentbox" selector): .commentsubfield { width: 390px; height: 90px; border: 1px solid #999999; padding: 5px; } .addacomment { position:absolute; width:250px; left:30px; top:180px; text-align: left; margin-bottom:3px; padding:0px; font-family:Arial, Helvetica, sans-serif; font-size: 12px; color:#000000; }

    Read the article

  • Autocad 2014 - Positioning electrical objects for plans (icons and symbols, not actual objects)

    - by zazkapulsk
    I am using Autocad to design my home. I am at a phase where I want to set the location for the switches, lighting fixtures, power sockets, communication sockets etc. I am thinking of something like this http://www.the-house-plans-guide.com/electrical-blueprint-symbols.html. I am not interested in placing specific lighting fixtures or rendering them, just putting the symbol and distances for the symbol. I can use Autocad Electrical, but that's a GIANT overshoot. What am I missing? Thanks.

    Read the article

  • positioning a div bottom of the page and keep content above

    - by Andy
    I have the following CSS which positions a div at the bottom of the page but how can i stop content flowing underneath it. #footer { position:fixed; bottom:0; background:url(../images/bg-footer.jpg) top; z-index:200; height:34px; width:100%; line-height:34px; padding:0; font-size:11px; color:#fff; } I cant add padding to the body or anything because i have a fullscreen background image in place as per this tutorial: http://css-tricks.com/how-to-resizeable-background-image/ Any help would be appreciated.

    Read the article

  • Overlapping divs, absolutely relative?

    - by askon
    A wordpress theme I'm working on has headlines which span across the entire content area. These headlines are overlapped by the sidebar which is absolutely positioned at 100% width. The issue, is when the sidebar's content exceeds the page's content, it stretches OUT of my wrapper overtop of the footer without forcing the it down (because it's absolute and nothing else is). So my question is, how would it be possible to make a absolutely positioned div, become relative and essentially "push" my footer down, or is there a better way to do this? Also, if anyone has examples of how this has been done would be awesome! edit: The sidebar is absolutely positioned so it can lay over top of the sidebar. I don't have an online example as I'm doing doing a local server set-up, everything else is relatively position, and likely floated. Image Example: http://imagecheese.com/gallery/stackquest.png

    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

  • Getting a divs z-index to overlap a div with absolute positioning

    - by Paul Herron
    Does anyone know how I could get the logo at the top of my page to appear on top of the curtains. http://nuigums.tumblr.com/ The logo is within a section tag along with the rest of the content with a z-index of 2, which is required to get the footer reveal effect I want. The curtain has a z-index of 3. I tried setting the z-index of the logo div to 4 but I presume the fact that the sections styling overrides that? I would like the logo to scroll with the content of the page also. Thanks. :)

    Read the article

  • Searching for URL's Relative to Site Root in Javascript Source

    - by James
    Hi, I am working on a web site with several other developers and we have had problems where people commit JavaScript code with AJAX calls that use URL's relative to the site root. An example would be /Home/Index which will not work if the site is hosted in a virtual directory. To get round the problem we use a $.url() method to convert it to a full path, e.g. $("#container").load($.url("/Home/Index")) I am trying to write a unit test that will search each JavaScript file and find places where the $.url method is not being used. The only problem is that I cannot seem to write a regex expression to do this. I have tried the following: (?!\$\.url\()"(/\w*)+" But this does not work. I cannot find a way to say that I don't want the $.url in front. Does anyone know if this is possible? Note that I need regular expressions that are compatible with .NET Thanks.

    Read the article

  • Relative probabilities using random number gen

    - by CyberShot
    If I have relative probabilities of events A, B, C occurring. i.e P(A) = 0.45, P(B) = 0.35, P(C) = 0.20, How do I do represent this using a random number generator between 0 and 1? i.e. R = rand(0,1) if (R < 0.45) event A else if(R < 0.35) event B else if(R < 0.20) event C The above works for two events A,B but I think the above is wrong for three or more since there is overlapping. This is obviously a very simple question and the answer should be immediately evident, but I'm just too stupid to see it.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >