w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
XAML Property Element Not Found in Parent, what does it mean?
VisualStateManager.VisualStateGroups is attached property. Read the following topic, it may help you: http://msdn.microsoft.com/en-us/library/ms749011.aspx

Categories : Wpf

How to add a class to a parent element based on the child's class using jQuery
Update I wasn't taking into account the other class that was on the element, also made it remove the previously added class so you don't end up with all of them on there: $(function() { function setContainer() { var activeSlide = $(".flex-active-slide"); var activeSlideClass = activeSlide.attr('class') .replace('flex-active-slide', '') .replace("-slide", "-container") var slider = activeSlide.closest(".image-slider.full-width"); var latestClass = slider.data("latest-class"); if (latestClass) { slider.removeClass(latestClass); } slider.addClass(activeSlideClass) .data("latest-class", activeSlideClass); }

Categories : Javascript

Overriding a parent div class on a child element within that div with the same class
This will do your work: .carousel-search > .btn-group { background: rgba(x,y,z,1); //a is value of opacity } Also check it out. http://www.w3.org/wiki/CSS/Properties/color/RGBA

Categories : HTML

How add class to parent element
Use closest : $("#AllProducts li span:contains('" + serial + "')").closest('li') .addClass("backRed"); or has : $("#AllProducts li").has("span:contains('" + serial + "')") .addClass("backRed"); But the first one is clearer in my opinion and doesn't use an intermediate potentially heavy collection.

Categories : Javascript

How to reference the parent element in the DOM in an ASPX page?
td needs to be ran server side for it to be accessed and classed as a parent element. <td id="td" runat="server"> <asp:TextBox MaxLength="255" ID="myTextBox" runat="server"></asp:TextBox> </td>

Categories : HTML

Select the parent of an element which has a certain class
$('.nav').on('click', 'li a', function(){ var clickedLink = $(this); var prevActiveLI = clickedLink.closest('ul.nav').find('li.active'); var currentClickedAnchorsParentLI = clickedLink.parent(); });

Categories : Javascript

Adding a class to the last p element within a parent container
Give .last() a shot : $('div.jobpost_body p').last().addClass('classificationsContainer'); Supports IE 7. JsFiddle

Categories : Jquery

asp.net mvc set parent element class from ActionLink helper
Instead of the MenuLink helper you can simply use the @Url helper like this: <li class="active"> <href="@Url.Action("Index", "Home")"> </li> and write your custom Helper only to generate the result for class name (e.g. active ) so the final code would look something like this: <li class="@Html.YourCustomHelperForActiveTab("Index","Home")" > <href="@Url.Action("Index", "Home")"> </li> UPDATE: it might also be helpful to some people to mention that an example helper for getting the class for each tab could be like this: (Source) public static string ActiveTab(this HtmlHelper helper, string activeController, string[] activeActions, string cssClass) { string currentAction = helper.ViewContext.Controller. ValueProvider.GetVal

Categories : Asp Net Mvc

add class to parent li if Child element is actve
When you set the selected class on $(this) you can also do $(this).parent().addClass("selected"). parent() can be called again and again to go up the tree (li -> ul -> li etc).

Categories : Jquery

how to catch up a html element with same class which is under different parent using jQuery?
$('.quickview-btn').on('click',function(){ var pid = $(this).closest('.item').next('.item').find('.quickview-btn').data('pid'); }) Demo ----> http://jsfiddle.net/qSe6t/4/

Categories : Javascript

ruby webdriver ERROR: Element not found in the cache - perhaps the page has changed since it was looked up
def open_template id=0 sleep 1 box_list=browser.lis.find_all { |div| div.class_name =~ /^test/ } sleep 2 box_list.each do |each| str=each.a.attribute_value("href") if /?tid=d+/.match(str)[0].gsub!("?tid=", "").to_i==id if each.attribute_value("style")=="display: none;" each.parent.parent.div(class: "title_me_h").a(class: "more").click sleep 2 open_template(id) #add else here to break out of the loop else begin #if the element matchs and isn't hidden, do a click each.a(class: "li_box_cj").wait_until_present each.a(class: "li_box_cj").click rescue Exception => e puts "ERROR: #{e.message}" end end break end

Categories : Ruby

Selenium Webdriver with Java: Element not found in the cache - perhaps the page has changed since it was looked up
If there has been any changes to the page after you have initially found the element the webdriver reference will now contain a stale reference. As the page has changed, the element will no longer be where webdriver expects it to be. To solve your issue, try finding the element each time you need to use it - writing a small method that you can call as and when is a good idea. import org.openqa.selenium.support.ui.WebDriverWait public void clickAnElementByLinkText(String linkText) { wait.until(ExpectedConditions.presenceOfElementLocated(By.linkText(linkText))); driver.findElement(By.linkText(linkText)).click(); } Then within your code you'd only need to: clickAnElementByLinkText("Logout"); So each time it will find the element and click on it, as such even if the page change

Categories : Java

How to access parent's class property if the current class has been instantiated in the parent
Parent constructors are not called implicitly if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required. If the child does not define a constructor then it may be inherited from the parent class just like a normal class method (if it was not declared as private).

Categories : PHP

Find the first parent element but not before root parent element
You can quite easily use parents(): $('.child').parents('li.parent:not(.base-parent)').last(); Here's a jsFiddle.

Categories : Javascript

Finding if a element just holding one element and hide parent element if true
Try this. function hidePTags() { var pTags = document.getElementsByTagName('p'); for (var i = 0; i < pTags.length; i++) { if (pTags[i].children.length == 1 && pTags[i].children[0].tagName == "br") { pTags[i].style.visibility = "hidden"; } } }

Categories : Javascript

Floated element keeps full "original" width of inner narrower block element
CHANGE THAT WAY: .thumbs div{ float:right;/* UPDATE WITH */ width:20%;/* CHANGE WITH THE SIZE THAT YOU WANT FOR THE DIV */ border:solid 1px red; } .thums img{ float:left; } Than all will fit horizontal.

Categories : CSS

Adding a class with jQuery to parent element of a checkbox when that is clicked and the checkbox is hidden
So, if this is checked, check it ? if (this.checked) { $(this).attr('checked','checked'); } doesn't make much sense, why not just : $('.checkbox input').on('change', function() { $(this).parent('.checkbox').toggleClass('checked', this.checked); }); and never ever remove the checked attribute, set it to false with .prop('checked', false); or this.checked = false

Categories : Jquery

404 Page Not Found The page you requested was not found - CodeIgniter
change your base_url to http://www.yoursite.com don't put the application folder name in base url the index.php file will read it because it is set from the index.php. i hope this will solve your problem

Categories : PHP

Target an parent element but without knowing how many nodes are in between child and parent
use .closest() to do that For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. $(this).closest('.SomeWrapper').parent().animate({opacity: '1'},{duration: settings.fadeSpeed});

Categories : Javascript

find previous div with class name rather than using parent().parent()....parent()
closest('.A') should do it. That finds the first element in the element's ancestry (starting with the element and then going to its parent, etc.) matching the selector.

Categories : Jquery

Child element is not being added to parent (parent.appendChild)
You are not appending your newly created div to the DOM. Node.appendChild returns the newly created node(HTMLImageElement in your case). var div = document.createElement("div"); div.appendChild(dynamic); document.appendChild(div);

Categories : Javascript

How to get the attribute value from parent page.I tried using opener and window.parent.But doesn't work
Consider sending values "news1" and "image1.jpg" to page2 as URL arguments: <page2 URL>?news=news1&image=image2 Edited: Can you place your data into hidden inputs inside a form, and use your link to submit it (onclick="form.submit();")? This way you'll make a POST request instead of GET.

Categories : Javascript

is it possible to change https page to http without full page reload?
IF you have sensitive information, don't mix, just stick to HTTPS or go from single page to another page to handle the sensitive transaction. It all depends on your workflow in the application and what makes sense.

Categories : Javascript

SVG: Moving mouse to element triggers mouseout event of parent element (d3.js)
When you use mouseout and mouseover on a parent container, you get events when the mouse moves between descendant elements. If you only want to hear where the mouse enters or leaves the parent, use mouseenter and mouseleave instead.

Categories : Javascript

Make element width stretch to fit its children when element's parent has overflow: auto;
Adding display:table on the .bookcase element does almost what you need. FIDDLE The only difference is that instead of the scrollbars appearing when the longest bookshelf > 60% of the viewport width, they appear when the longest bookshelf > 100% of the viewport width. But the problem with the disappearing background is gone.

Categories : CSS

Image not taking up full width set on parent div
Just add this with your css..i tested it works This is what you want rit.. .ulteamlist {padding:0px;}

Categories : HTML

Unable to grab the element which is loaded using Load() method from parent Element
Try binding your click event in the complete handler, like so: $('#productsContainer').load('productsThumbs.aspx', function() { $('#productsContainer .productthumbs').click(function () {alert('Click');} ); }); edit: requested explanation The load() call is "asynchronous", meaning that while it does its work, your code will continue. This means the operation may not be complete when you try to manipulate the data it returns. The function we have added is a "callback", which will run when the load operation completes. If you perform your manipulation here, you can be sure that the elements you are working on exist ( assuming the load was successful ) It is similar to the callbacks you might have used in jQuery animation.

Categories : Jquery

How to make a scrollable element fill 100% of the remaining height of a parent element?
Here is an experimental CSS possibility note - i made the height and width of the container wider to see it more clearly. #container { height: 200px; width: 200px; border: solid; overflow: auto; } #titlebar { background: gray; } #body { height:calc(100% - 4em); /* definitely non standard - the 4 em is an approximate size of the titlebar*/ overflow: auto; background: lightblue; } /*Old answer - disregard / /#container { height: 100px; width: 100px; border: solid; overflow:auto; /* overflow belongs here*/ } #titlebar { background: gray; } #app-body { background: lightblue; }*/

Categories : CSS

In jQuery, how to remove all occurrences of a CSS class, and add it once to a specific sibling of the tag's parent's parent?
Try this $('a.active').closest('ul') .prev() .addClass('ui-state-active') .siblings('h3') .removeClass('ui-state-active');

Categories : Jquery

How to call parent class' method from a subclass in JavaScript so that parent's local variables would be accessible?
No you can't see the parents local variables. You inherit the parents prototype chain, not their local state. In your case you're applying the parent function onto the child object which does not hold the state. apply(this,...) means that you're binding the function to the current value of this. when you call method b from the child object, its then bound to the child, and therefore is not operating within the closure that contains the parents value.

Categories : Javascript

Jquery Scrolling Element to Position of Newly Appended Element (Calculating relative offset to parent)
change to: ul.stop().animate({ scrollLeft: li.position().left + ul.scrollLeft() }, 2000); You are looking for position() method, which returns relative position, instead of offset, which returns absolute (more proper - relative to the document) position, and add current scroll state (which affects the position reading)

Categories : Javascript

How to give a child element a higher z-index than the parent element
z-index is relative to the siblings within the same parent. you will have to take the <a> out of the <header> to create the desired effect. If the parent has lower z-index than the modal, everything in it will be behind the modal, regardless of the children's z-index Please also attach a jsFiddle or something so we can show you how to fix this.

Categories : HTML

Can a parent class have a parent method that appends extra functionality?
You could make use of super. class Question < ActiveRecord::Base def generate_response(obj) static info end end class InheritsFromQuestion < Question def generate_response super(self) #this will call the parent class (Question) method rest of whatever end end

Categories : Ruby On Rails

Parent element does not close after deleting an element: XML Twig
As mentioned, the XML is not valid, and the code doesn't compile. That said if I understand correctly, I think the handler should be: sub upd_files_section{ my ($t, $inputFields)=@_; my @files_to_delete = $inputFields->get_xpath("./File[@RelativePath='..\..\TS\ETestScenario.inc']"); foreach my $file (@files_to_delete) { $file->delete; } $t->flush; } A few notes: you need to escape the backslashes in the XPath expression, or Perl thinks they're there to escape the following character; alternatively, use simple quotes or q{} around the expression: q{./File[@RelativePath='....TSETestScenario.inc']} in the XPath expression, it should be @RelativePath, not @att get_xpath returns a list of elements, which you have to delete to delete an element call delete on it,

Categories : Xml

Set child element height to 100 percent of parent element
You could use display:table / table-cell ( http://jsfiddle.net/BZNUr/14/ ) : #container { display:table; } .button { display:table-cell; } That will change some of the other visual aspects, but you could compensate by changing other CSS properties (I didn't do this because I wasn't sure if it was important to you).

Categories : HTML

Is there any performance or memory improvement between importing a class and using references with full class name?
No, there is no difference. import statement is used to avoid using fully qualified names of the class we are using. The documentation doesn't talk anything about performance improvement

Categories : Java

Switching to Parent Frame from iFrame and finding an element in Parent frame using Selenium Webdriver. C#
Thats for your responses guys. It is solved! The solution: While I use the webDriver.SwitchTo().DefaultContent(); it switches the webDriver to the top most window of the page. [Previously I was looking for the button element in this window and therefore was not able to find it as the button was sitting in the main frame of the page] After switching to the main window, I switched the webDriver again to the main frame of the page. This main frame had the button element. Thus I was able to find the button element. And this slved the issue! So the final code doesn't have webDriver.SwitchTo().DefaultContent(); but has the following in its place: _webDriver.SwitchTo().Window(windowHandle); _webDriver.SwitchTo().Frame("mainFrame"); Note: windowHandle in the above code is the hand

Categories : C#

XML element removal, just need to delete one element not the parent
You should be able to drill down to the desired elements then remove them. For example, assuming your XML is in an XElement, this approach would work: string targetCategory = "G554"; string vsloc = "V002"; xml.Element(targetCategory) .Elements("VSLOC") .Where(e => e.Value == vsloc) .Remove(); If you're using an XDocument then add the Root property: xml.Root

Categories : C#

When access image file throgh url it redirects to page not found page in drupal6
It might be caused by the pathauto module.In Administer › Site building › URL aliases you can find the automated alias settings tab.Under that go to the general settings area.You might have set character case set to change to lowercase.Hope that might be your problem.. :)

Categories : Htaccess

Page Not Found in title of WordPress page on template_redirect using include()
You can do this by inserting a small piece of JavaScript: <script> $(document).ready(function() { document.title = 'your title here'; }); </script> If you want the title to be dynamic then replace with: document.title = <?php echo 'your dynamic title here'; ?>;

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.