parent

jQuery, $(this).parent() and blur()

I cannot get the blur() function in the following to work: $('.newselect').focus(function(){ $(this).parent().append('<div class="select_container"></div>'); }); $('.newselect').blur(function(){ $(this).parent().remove('.select_container'); }); However if I use a universal selector $('*') (as below) it works, why is this and h...

Parent's Enum in Java

In the code example below, I'm trying to test the value of an enum in the parent class. The error I get is "p.theEnum cannot be resolved or is not a field.", but it's the exact same code I use in the parent class to test the value (without the p. obviously). Where am I going wrong? :) public class theParent { protected static enum ...

C++ - How to call creator class/object

Hi guys, I need to call properties and functions of an object from a different class. The idea is passing 'this' as a parameter to the other class constructor. E.g.: instance = ClassName(this); And then do: ParentClass parentInstance; ClassName::ClassName(MainApp _instance){ parentInstance = _instance; } However, my compiler ...

get parent frame height with jQuery

I want to get the height of parent frame with jQuery. It's my orginal script var iframeElement = parent.document.getElementById('FrmPatient'); iframeElement.style.height = 170; I want to change this script to jQuery style. How to get that? ...

Using jQuery set parent element css based on condition of multiple children element

<tr> <td class="cat" CategoryId="8">NoChange*: </td> <td><span class="itm" CategoryId="8">A</span></td> </tr> <tr> <td class="cat" CategoryId="9">Row should be red*: </td> <td></td> </tr> <tr> <td class="cat">Comments:</td> <td><span class="itm"></span></td> </tr>​ I want to set Validation for Category which d...

Overriding a Javascript method only if it does not exist

My goal here is to override a method if it isn't found, otherwise use the original method (for backwards compatibility of a library I can't alter). This is what I have so far, but am still struggling with: this.grid.getDataSource = function(){ if (typeof this.grid.getDataSource.getDataSource == "undefined") return t...

Need clean jQuery to change parent's class when children are clicked

I needed some method of adding/removing classes of a parent element when it's children are clicked to reflect which child is currently selected. In this case a UL parent and LI children in a tab scheme. I needed a way to mark the current tab on the UL so I could style a background sprite on the UL; since styling my LI's backgrounds would...

PHP SimpleXML XPath get next parent node

Hi, I've never asked a question here before so please forgive my question if its formatted badly or not specific enough. I am just a dabbler and know very little about PHP and XPath. I have an XML file like this: <catalogue> <item> <reference>A1</reference> <title>My title1</title> </item> <item> <reference>A2</reference> <t...

Silverlight - Binding Listbox ActualWidth to ListboxItem Width

Hi, I'm working on a photo gallery for Windows Phone 7 and I'm trying to get each image to take the full screen and slide horizontally. What I am doing so far is to use a listbox that I have modified to scroll horizontally but the problem is that I can't seem to find a way to bind the width and the height of the ListboxItem with the A...

Communicating back to parent from a Webkit notification

I'm using webkitNotifications and createHTMLNotification, etc. to successfully create a notification in Chrome (Windows). Now I would really like to have the notification window communicate back (or at least set the focus to) the tab/window that created the notification (which is part of the spec). I realize it's still in the early pha...

Very basic question about parent() and prev() in jQuery

Hi, I am handling a hyperlink's click event with a JavaScript function. I want to retrieve data from the hyperlink. The page looks like this: <div class="div1"> <div title="Title 1" class="div2"> <p class="p1"><a class="linkJs">The link in question</a></p> </div> </div> <div class="div1"> <div title="Title 2" class="di...

jquery get the parent of the parent

I'm trying to hide a layer but can't seem to figure out how to get this working here's what i'm trying if ($('#dgAvailable_ctl02_lblpricefrom > strong').text() == '£'){ $('#dgAvailable_ctl02_lblpricefrom').parent().parent().hide() } And my code is <div class="resultsitem" style="background-color: rgb(238, 229, 208);"> <div class...

jQuery - parent() not working within callback function

I was testing with parent() and closest(), none work within function. TD stays the same, no change using this method: $.get('form.php', function(data){ alert(data); $(this).closest('td').html('Done!'); }); TD gets updated, this method works: $.get('form.php', function(data){ alert(data); }); $(this).closest('td').h...

JQuery Selector Issue: How to select anything is a child of the current list item.

I'm sure that title is confusing. This is a Wordpress thing. So, I have a list of pages and the structure looks like this: <div id="menu"> <ul> <!--List of pages--> <li class="page-item page-id"> <a href="Page url"> Ham Man </a> <ul class="children"> <li class="page-item page-id"> <a href="...

Getting a relative positioned DIV to take up the remainder of it's parent's vertical space

I'm working on a web application that has a couple widgets positioned all the way on the right using a container DIV with absolute positioning. The first (top) widget is small but with a dynamic/undefined height. The second (bottom) widget contains scrollable content and must stretch to fill the remaining space of its parent DIV. I'm ...

Using SQL Report Builder 2.0 to group by Parents/Children

Hello, this is my first post, so I hope I get everything right... I am trying to generate a report that shows a summary of items held for each customer in our database. Our customers can have children companies, so I need the report to group on the parent company, then show the children and their sums, and then show the total for the P...

get the parent url of iframe in PHP

I am creating a widget that would load in a IFrame and users will be able to place the widget on their own website. How would I get the URL of the website that is using the IFrame in javascript and/or PHP? The IFrame loads a php file. I have tried "parent.top.location.href" and "parent.document.referrer" in the IFrame page but that is u...

CSS Multiple selection based on parent

Hello! For the below code: <div id="main"> <div class="one"></div> <div class="two"></div> <div class="three"></div> </div> I want to select all of the 3 divs inside by class name and parent like this: div#main div.one div.two div.three{/*apply common properties for all 3*/} ^ Doesn't work. This is an abstract example so...

Parent process doesn't complete after child is terminated in C

I'm having trouble with a process forking exercise. I want to fork a child process and have it hang after announcing it has been forked, and wait for a signal to terminate, after which the parent process must announce it is terminating and then exit. I can get the processes forked and have the parent wait for the hanging child to be k...

wpf contextmenu gets style from it's parent

Hi I have a problem with context menu. I override default context menu from textbox with my own menu. The menu is created dynamicly and looks like that ContextMenu menu = new ContextMenu() MenuItem item1= new MenuItem(); item1.Header = "First item"; MenuItem item2 = new MenuItem(); item2.Hea...