parent

How do I Scroll parent page to top when child page is click within iframe?

我是研究僧i 提交于 2019-11-28 06:14:50
When someone clicks on a link within an iframe (child page), how do I get the parent page to scroll to the top? The issue is the child page will remain in the same spot of the page, because the iframe has a lot of height larger than the parent page. Please note: the parent and child pages are on different sub domains. I created a demo to show this: http://www.apus.edu/_test/iframe/index.htm Evan The trick is to append the following onload="window.parent.parent.scrollTo(0,0)" to the iframe and that should do it! Using JavaScript within the iframe, reference the parent and call the scroll()

Win32 window Owner vs window Parent?

蹲街弑〆低调 提交于 2019-11-28 04:50:28
In Win32 programming, what is the difference between a window's parent and a window's owner? I thought I had it figured out, then I came across this code: SetWindowLong(handle, GWL_HWNDPARENT, foo); This actually sets the window's owner, not the parent - despite the GWL_HWNDPARENT being used. Are the terms parent/owner interchangeable, or is there actually a difference? Owner is the Window* responsible for a control or dialog (for example, responsible for creating/destroying the window). Parent is the next-senior window* to a control or dialog in the window chain, but isn't actually

How to create a delphi form containing multiple 'child' forms that can be moved/sized and show activated

 ̄綄美尐妖づ 提交于 2019-11-28 04:40:27
问题 I've created a form that hosts one or more 'child' forms. In my edit mode, each child form shows its border and caption bar allowing it to be moved and sized (a bit like the old MDI app). Out of my edit mode, the borders disappear and the child forms are fixed in position. For my simple demo, I'm creating the child forms thus: procedure TForm1.Button1Click(Sender: TObject); var Frm : TForm; begin Frm := TForm3.Create( Self ); Frm.Parent := Self; Frm.Visible := True; The result is a layout

WPF Binding parent property in HierarchicalDataTemplate

一个人想着一个人 提交于 2019-11-28 04:24:32
问题 I have a WPF TreeView with 2 levels of data and 2 HierarchicalDataTemplate to format each level. From the HierarchicalDataTemplate at the second level, I need to bind a property in the class of the first level. I have tried in this way, but it dosn't work: Text="{Binding Path=Ori, RelativeSource={RelativeSource TemplatedParent}}" with Ori as the name of the propery Even in this way it dosn't works: Text="{Binding Path=tOri, RelativeSource={RelativeSource TemplatedParent}}" with tOri as the

How to access properties of Python super classes e.g. via __class__.__dict__?

戏子无情 提交于 2019-11-28 03:23:03
问题 How can I get all property names of a python class including those properties inherited from super classes ? class A(object): def getX(self): return "X" x = property(getX) a = A() a.x 'X' class B(A): y = 10 b = B() b.x 'X' a.__class__.__dict__.items() [('__module__', '__main__'), ('getX', <function getX at 0xf05500>), ('__dict__', <attribute '__dict__' of 'A' objects>), ('x', <property object at 0x114bba8>), ('__weakref__', <attribute '__weakref__' of 'A' objects>), ('__doc__', None)] b._

jQuery select descendants, including the parent

人盡茶涼 提交于 2019-11-28 02:29:24
问题 Consider the following HTML: <div class="foo" id="obj"> I should be changed red <div class="bar" style="color:black;"> I should not be changed red. <div class="foo">I should be changed red.</div> </div> </div> Given a DOM element obj and an expression, how do I go about selecting any children and possibly obj ? I'm looking for something similar to "select descendants" but also including the parent, if it matches the expression. var obj = $("#obj")[0]; //wrong, may include siblings of 'obj' $(

How to override a LESS mixin variable based on a parent's variable

半城伤御伤魂 提交于 2019-11-28 02:21:19
I am a newbie, so be gentle. I am sure my terminology is incorrect too: suppose I have my own jumbotron override: .jumbotron { background-color: #ff4400; } and then I want to have a custom override of that where I inherit the above class and only override its background color using its color as a parameter to "lighten()". I can't figure out the syntax: .Myjumbotron { .jumbotron; /* not sure what goes below for "parent.background-color" */ background-color: lighten(parent.background-color, 30%); } Harry LESS allows you to define variables. So you can define a variable for the parent's color and

Move files up one folder level

爱⌒轻易说出口 提交于 2019-11-28 02:17:38
I have a folder called "April reports" that contains a folder for each day of the month. Each folder then contains another folder which contains PDF files: April reports ├─01-04-2018 │ └─dayreports │ ├─approved.pdf │ └─unapproved.pdf │ ├─02-04-2018 │ └─dayreports │ ├─approved.pdf │ └─unapproved.pdf ╎ ╎ └─30-04-2018 └─dayreports ├─approved.pdf └─unapproved.pdf The PDFs have the same name for each day so the first thing I want to do is move them up one level so that I can use the folder name containing the date to rename each file so that it will contain the date. The script I have tried is this

Forwarding child control MouseMove events to the parent seamlessly

北城以北 提交于 2019-11-28 02:07:51
问题 I have a custom UserControl that I am drawing using the GDI+. It is a transparent control which draws small shapes on top of the parent control. All the parent window does is creates the control, gives it a Rectangle in which to draw itself, and then it receives events if the user clicks on the non-transparent areas. The drawing part works perfectly, but right now what I need to do is to as seamlessly as possible forward all MouseMove, MouseClick, etc. events to the parent control IF those

How do I call PHP parent methods from within an inherited method?

試著忘記壹切 提交于 2019-11-28 01:28:05
问题 In PHP, I'm trying to reference a method defined in an object's parent class, from a method inherited from the object's parent class. Here's the code: class base_class { function do_something() { print "base_class::do_something()\n"; } function inherit_this() { parent::do_something(); } } class middle_class extends base_class { function do_something() { print "middle_class::do_something()\n"; } } class top_class extends middle_class { function do_something() { print "top_class::do_something()