position

Get the number of an element's pixels which are inside the viewport

被刻印的时光 ゝ 提交于 2019-12-11 10:38:43
问题 I'm trying to get the total number of a given html element's pixels which are visible inside the viewport. This question and accepted answer Can I detect the user viewable area on the browser? were very useful for determining whether the element is in view/out of view/partially in view, but for the partially in view case I need to get the total (vertical x horizontal) number of pixels not obscured by the viewport. I was trying something like this, but the horizontal value is always wrong: var

linq find in which position is my object in List [duplicate]

若如初见. 提交于 2019-12-11 10:33:16
问题 This question already has answers here : How to get the index of an element in an IEnumerable? (12 answers) Closed 5 years ago . kriteriji is type of List<Kriteriji> var doc = kriteriji.Where(k => k.Ean == txtEan.Text && k.PredmetObravnave == acPredmetObravnave.Text && k.Tse == txtTse.Text && k.DejanskaKolicina == Convert.ToInt32(txtKolicina.Text) && k.KratekNazEnoteMere == acKNEnotaMere.Text && k.OznakaLokacije == acOznakaLokacije.Text && k.OznakaZapore == txtZapora.Text && k.SarzaDob ==

CSS: Why an input width:100% doesn't expand in an absolute box?

泄露秘密 提交于 2019-12-11 09:57:19
问题 I have 2 inputs: they both have a width: 100% , and the second one is an absolute box: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <style type="text/css"> #box1 { position: absolute } #box1 { background: #666 } input { width: 100% } </style> </head> <body> <form> <input type="text"> <div id="box1"> <input type="text"> </div> </form> </body> </html> On

Scroll to a postion in a Web Browser using Wpf

空扰寡人 提交于 2019-12-11 09:49:40
问题 I cannot seem to programmatcally scroll in WPF in a normal Windows Form I would use the code below but that property does not exist in WPF. HtmlDocument doc = this.webBrowser1.Document; doc.Body.ScrollTop = 800; return; Is there an alternative to doing this? 回答1: Not exaclty sure what to look for in that code, but I basically have a WebControl that shows a Webpage that has several articles. I would like to jump to an article by it's title. I know I can get the index of the article name, but

Element width expands as height increases

偶尔善良 提交于 2019-12-11 09:41:32
问题 I used CSS :before and :after to create a paper like layout with a div. It's fine but the width increases as the height increases. I've tried max-width but to no avail. Any ideas on how this can be prevented. HTML <div class="rack"></div><!-- End Rack --> CSS .rack { width: 70%; height: 100%; background: #7FAE68; margin: -255px 0 100px 0; position: relative; float: left; left: 15%; z-index: 9999; transform:rotate(1deg); -ms-transform:rotate(1deg); -webkit-transform:rotate(1deg); padding

Why is position().top changing when I scroll the parent?

自古美人都是妖i 提交于 2019-12-11 09:23:40
问题 jQuery position() returns the current coordinates of the first element in the set of matched elements, relative to the offset parent. So, scrolling the parent is not supposed to change the position , right? The result I'm getting in this fiddle is that after scrolling the parent by 100px, the position().top of a child element changes by 100. position().top before scroll 1880, after scroll 1780 Why? 回答1: To answer the question in your comments, just add the box's scrollTop to the anchored

Bash text absolute positioning

纵然是瞬间 提交于 2019-12-11 09:17:16
问题 How can you do absolute positioning of output? Very similar to like when Linux first boots and you see the following: Starting process blah blah blah [ OK ] 回答1: You can see the code used to produce those [ OK ] in many Linux distributions in /etc/init.d/functions $ grep echo_ /etc/init.d/functions echo_success() { echo_failure() { echo_passed() { echo_warning() { $ Upon inspection, you will see that those function use ANSI escape sequences. echo_success() { [ "$BOOTUP" = "color" ] && $MOVE

Controlling position of subsystems in Sankey-diagram with matplotlib

自闭症网瘾萝莉.ら 提交于 2019-12-11 09:02:56
问题 I have the following question: I would like to add two subfigures to a Sankey diagram, that are not connected to each other. if I draw: import matplotlib.pyplot as plt from matplotlib.sankey import Sankey fig = plt.figure(figsize = (12, 5), frameon=True) ax = fig.add_subplot(1, 1, 1) sankey = Sankey(ax=ax, unit=None, radius=0.15, shoulder = 0, gap = 0.15) sankey.add(flows=[0.2, -0.2], label='A', orientations=[-1, 0]) sankey.add(flows=[0.1, -0.1], label='B', orientations=[1, 0]) diagrams =

WPF: How can i scale to fit the content?

柔情痞子 提交于 2019-12-11 08:52:44
问题 It gets basicaly to this: I have a canvas container (x:name="Container" - to reffer later to), with some other controls(e.g. I have a Button 30x60 in size) and I want to scale the Container to fit the button, without having to resize anything. (just using scaleTransform) If I set a slider binded to the Container Scale, I can slide it to fit the button, but the value is 1.1343 and I want to be able somehow to compute this value programatically, because all the controls inside Container are of

android: videoview history/bookmark

橙三吉。 提交于 2019-12-11 08:52:27
问题 I have a videoplayer application. Suppose the user has played a video and after playing half of the video, the user pressed the back button or exists the application. I want that position to be remembered so that the next time, the user plays the same video, the video starts from exactly the same position from where it was left. Any ideas in this regard? Thanks much 回答1: First, you will need to store this data in some database, but it's quite simple. Now, you should add a check in the onPause