sibling

Jquery and Safari

Hello all, I'm having an issue with JQuery and Safari (Windows Version). The code works on FF/IE7/Chrome but not Safari. I have a simple <li> that has a <div> embedded in to - clicking the <li> should expose the hidden div, but not in Safari. The HTML: <ul> <li>something</li> <li>something2</li> <li class="more"> <a href="" ...

Hide an element's next sibling with Javascript

I have an element grabbed from document.getElementById('the_id'). How can I get its next sibling and hide it? I tried this but it didn't work: elem.nextSibling.style.display = 'none'; Firebug error was elem.nextSibling.style is undefined. ...

Removing active class and adding it to a sibling

Currently, I have a jQuery Cycle plugin that allows the image to scroll. With it's callback I am calling this function function onAfterVideoScroll() { $('.myRemote.active').removeClass("active").next().addClass("active"); } This SHOULD be removing the current class from another set of links, and adding the class to the it's next sib...

Efficiently Detect When Sibling Elements Overlap

Example: <div id="big">&nbsp;</div> <div class="small">&nbsp;</div> <div class="small">&nbsp;</div> <div class="small">&nbsp;</div> <div class="small">&nbsp;</div> <div class="small">&nbsp;</div> <!-- ...and so on --> "#big" is positioned absolutely behind a portion of the ".small"s, but is not a parent element. I have been doing thi...

CSS adjacent sibling selectors - IE8 problem.

I am creating a menu system using a UL/LI structure. I'm trying to use sibling selectors for hover/show-sub-menus. I'm using this; #MainMenu li.Sel ul li.HasSub a:hover+ul { display: block; } The UL structure would be something like this; <ul id='MainMenu'> <li class='Sel'> <a href='#'>Click Me</a> <ul> <li c...

Xpath select following (number) sibling inside anchor help

Sorry in advance if I don't explain this clearly. I will try my best to clarify what I am trying to do. Without further ado...Suppose you have a series of numbers on a page (separated by only a space) where brackets indicate the current page you are on. It looks like this on the page: [1] 2 3 The HTML looks like this: <tr> <td> [<a...

Jquery: How to get to a particular child of a parent?

Hi, To give a simplified example, I've got the following block repeated on the page lots of times (it's dynamically generated): <div class="box"> <div class="something1"></div> <div class="something2"> <a class="mylink">My link</a> </div> </div> When clicked, I can get to the parent of the link with: $(".mylink").clic...

jQuery - hide if previous element has a particular class

Hi I would like to hide all class="csc-content" where previous sibling is a h4 class="faq". UPDATE Error: I think this is wrong... the previous sibling is not h4. But I hope you get the point that all "answer" shall be hidden if the "question" has the class "faq" /UPDATE This is the html: <div id="centerCol-1"> <div id="c65" class=...

jquery fail to retrieve accurate data from sibling field.

wonder what's wrong <table id=tblDomainVersion> <tr> <td>Version</td> <td>No of sites</td> </tr> <tr> <td class=clsversion>1.25</td> <td><a id=expanddomain>3 sites</a><span id=spanshowall></span></td> </tr> <tr> <td class=clsversion>1.37</td> <td><a id=expanddomain>7 sites</a><span id=spanshowall></span></td> ...

beautifulsoup: find the n-th element's sibling

I have a complex html DOM tree of the following nature: <table> ... <tr> <td> ... </td> <td> <table> <tr> <td> <!-- inner most table --> <table> ... ...

jquery access sibling TD in table

I have the following HTML Code. What I'm try to do is to have the div named javaRatingDiv to be displayed once the checkbox with the name java is checked. I can't seem to figure out how to navigate to the next TD in a table via jquery. <div id="languages"> <table style="width:inherit"> <tr style="height:50px; vertical-align:to...

nextSibling issue, again... sorry...

Ok, I am using insertRow to insert a TR element into a table, but for some reason it doesn't count that inserted TR element as a sibling of the others when I do nextSibling on it. For example, consider the following table. <table id="myTable"> <tr id="row_0"> <td colspan="3">Row 1</td> </tr> <tr id="tr_0_0"> ...

jQuery next sibling li not working on last item

This is currently working, for the most part: $(".nextproject").click(function() { $(window).scrollTo( $(this) .parents() .nextAll() .find("li:visible:first"), 1000, {easing:'easeOutExpo', axis:'x', offset:-75 } ); }); You can see the demo here: http://www.studioimbrue.com/index2...

Looking to simplify adding an attribute based on sibling's text

I would like to add a Title attribute to a row and the value is retrieved from the row's sibling which is hidden, unless clicked. I wanted to make it generic enough to handle when some screens don't have the hidden row with the text. Here is the first pass that works: $(function() { $("td.commandText pre").each(function(index) { ...

In a tree data structure, is a node a sibling of itself?

I am building a tree like data structure. What is the expected behavior if I have a method public Set getSiblingNodes(Node node); Should this method return a set including or excluding itself? Thanks! ...

jQuery: Parent or Sibling? And how to 'instruct' a sibling search?

I have a list that looks like this: <li class = "current_parent level-0"> <a> Parent Link </a> <ul class= "children"> <li class = "level-1"> <a> Link to child </a> </li> <li class = "level-1 current_page_item"> <a> Link to child </a> </li> <li class = "level-1"> <a> Link to ...

Get the href of the previous sibling and update the href of the current item

I've ended up and done this by hand, but I was thinking this could be done much quicker with some jquery. I have a table with dozens of the example rows below. What I'd like to do is find the previous siblings of the <a href="#">, grab their URL, change the filetype to .doc and apply. <tr id="node-20" class="child-of-node-19"> ...