position

Two scrollbars problems?

☆樱花仙子☆ 提交于 2019-12-08 09:16:12
问题 Following up on this post, I made a test, but I still got a bit of problem - the page has two scroll bars when you click to display the image. I don't need the background scrollbar when the image is being displayed, I only need the scrollbar on the image container. How can I hide the background scrollbar without making the page jumpy? the css, #container-image { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow-x: auto; overflow-y: scroll; z-index:100; } the html, <p

Get x,y position of a specific pixel

女生的网名这么多〃 提交于 2019-12-08 09:07:33
问题 I got a little problem, I got a code, that reads all pixels and takes the RGB color of the pixel. But before that, I cut the picture into chunks, so I can also calculate larger images, without exceeding memory. Here is the code: Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); try { decoder_image = BitmapRegionDecoder.newInstance(filePath, false); } catch (IOException e) { e.printStackTrace(); } try { boolean bool_pixel = true; final int width = decoder_image.getWidth(

SpriteKit Camera position correction in iOS10?

只谈情不闲聊 提交于 2019-12-08 08:20:31
问题 When converting my App, which has a SpriteKit scene in it, to iOS 10 I have had to convert my scene's original camera position from: cameraNode.position = CGPoint(x: self.size.width/2, y: self.size.height/2) to account for iOS10 with: if #available(iOS 10, *) { cameraNode.position = CGPoint(x: self.size.width/2, y: (self.size.height + voidSize)/2) } else { cameraNode.position = CGPoint(x: self.size.width/2, y: self.size.height/2) } The iOS10 version actually makes more sense as I do have part

jQuery .css border-radius does not work with position:absolute?

狂风中的少年 提交于 2019-12-08 07:56:42
问题 I have a series of images that makes a gallery-type of display. I use jQuery to make them round with a random diameter for each. It works perfectly fine, but then I need to place them correctly. The problem is that giving the <div> that contains the image a position:absolute (or any kind of position) turns the <div> back into a square. Is there a fix? Am I doing something wrong? I made a Fiddle to make the code clear. 回答1: Putting a wrapper <div> around each image, seems to solve it... http:/

find top and last element inside a scrollable div

不打扰是莪最后的温柔 提交于 2019-12-08 07:33:17
问题 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. 回答1: Get your div's scroll position var scrollY = document.getElementById("yourDiv").scrollTop; Loop through the elements inside and look at their position var divs = document

Image position equivalent to background position

前提是你 提交于 2019-12-08 07:11:12
问题 I am working on a website and I want to style an image like you style a background with background-position: center. Is there an equivalent to this for a regular image? Thanks in advance, Luuk EDIT: The image is responsive and contained in a container. CSS: .img-container { max-height: 300px; overflow: hidden; } .img-container img { max-height: 100%; max-width: 100%; } 回答1: I would do something like this to position the image centered. .img-container { display: flex; justify-content: center;

position divs at top and bottom of containing div

非 Y 不嫁゛ 提交于 2019-12-08 06:51:12
问题 I have a container div which has content that will sometimes need to be divided by class="top" and class="bottom" . Obviously there is no float:top or float:bottom , so what is the best way to achieve this with html/css alone? Ex: <div class="content"> <div class="left"> <a href="#"><img src="img/home.jpg" alt="salon home"></a> </div><!-- end left --> <div class="center"> <a href="#" class="top"><img src="img/about.jpg" alt="about salon"></a> <a href="#" class="bottom"><img src="img/services

Set Div TOP position as percentage of browser width (define height position by width)

对着背影说爱祢 提交于 2019-12-08 06:11:29
问题 I am assuming I will need Javascript for this, but perhaps there is a CSS trick I'm not aware of. I have a web page based on a square background image. Ideally, the user would always set the browser as a square, but I know that won't happen. Because the image is square, if the image is set to fill the browser at 100%, the width is always the same as where the "bottom" of the page should be. Thus, to position an element dynamically horizontally (so the page can be resized but still hold it's

How to make an object move towards another object in C# XNA

偶尔善良 提交于 2019-12-08 05:13:36
问题 I'm currently trying to make an object move towards another. I have this code so far to try and achieve it. double angleRad = Math.Atan2(mdlPosition.Z+treeTransform.Translation.Z, mdlPosition.X-treeTransform.Translation.X); enemyPos.X += (float)Math.Cos(angleRad) * 0.2f; enemyPos.Z += (float)Math.Sin(angleRad) * 0.2f; Whenever I move my player character, the object moves, but not towards the characters current position. How can I direct it towards current position? 回答1: Normally you should

make div fill the rest of the browser viewport

眉间皱痕 提交于 2019-12-08 04:51:07
问题 so i have a normal 960px layout, i want to add a div that can use 300px inside that 960 and the rest of the space (browser width) i want to fill with that div...but always stay on the same position inside the wrapper (im not talking about a vertical fixed element) can i do this without using javascript? but if theres isnt another option its ok Example: <div class="wrapper"> <div class="fill">Something</div> </div> CSS: .wrapper { margin: 0 auto; width: 960px; background: #ddd; } .fill {