traversing

Find a dynamic added tag with javascript

I am trying to see how to find a tag that was added dynamically within a table as so: ParentTag= document.getElementById('parentdiv'); var newTag = document.createElement('div'); newTag.innerHTML="<span class="ImNew"></span>" ParentTag.appendChild(newTag); How will I be able to find that tag in javascript, not leaning towards using j...

what is the name of snake-like image traversing algorithm?

The algorithm name is after some mathematician. You can traverse image line by line of course, but you can traverse image using recursive generated path, which the basic blocks looks like: U This one is for traversal 2x2 pixels image. If you have bigger image, you "multiply" this block (rotated or not) for each segment. The result is ...

Traversing from Bookmark Hashtags (#bookmark) in jQuery?

I am having trouble traversing from a bookmark has tag in jquery. Specifically, the following HTML: <a id="comment-1"></a> <div class="comment"> <h2 class="title"><a href="#comment-1">1st Post</a></h2> <div class="content"> <p>this is 1st reply to the original post</p> </div> <div class="test">1st post second line</div> ...

.next is undefined, jquery plugin problem

I'm trying to create my own plugin. But I'm having trouble getting things right. It appears when I'm trying to traverse inside .each things go wrong. I'm trying to go to the next item every 6 seconds by fading. jQuery(function($){ $.fn.rotator = function(options){ this.each(function() { var container = $(this); ...

Changing A Different Class Display on Hover with Jquery

Ok, here's what I'm trying to do. I have a DIV box with a child element set with DISPLAY: NONE;. I'm trying to use Jquery so that when the mouse enters the parent DIV box, the child element is made visible, and then hides when the mouse leaves the parent DV. There will be multiple divs on the page with these classes. For some reason it's...

How do I wrap a repeatbale set of elements in jQuery?

In jQuery how would I go about wrapping a repeatable set of elements with a div? For example I have: img h4 p img h4 p img h4 p I need to wrap each img, h4, p set with a div class="container". So it will look like: <div> class="container"> img h4 p </div> <div> class="container"> img h4 p </div> <div> class="container"> img h4 p </div> ...

Accessing XML/PHP with period in tag

Hi guys, Quick newbie question here, how do I access totalResults? XML <?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"&gt; <opensearch:totalResults>1</opensearch:totalResults> <posts> <post> <score>10</score> </post> </posts> </OpenSearchDescript...

jQuery filter() traversing doesnt seems to work ??

I dont know what is the problem with this ? $('.post').live('mouseenter mouseleave', function() { $(this).filter('anything here,a,div,.class,#id').toggleClass('hidden'); }); where as this works fine. $('.post').live('mouseenter mouseleave', function() { $(this).toggleClass('hidden'); }); There is an an...

File Hierarchy system with a web application logic question: List searching

I need to search through a list of folders that could have more folders inside it, and add a new folder depending what folder is its parent.(the path is stored as a String for eg = "root/MyCom/home/") Then i fill in a field with a new folder name and add it to the final folder(eg "home/"). Below as you can see , I can navigate to the r...

finding specific immediate children of an element using prototype

Following DOM structure: <ul> <li class="item">yes</li> <li>no</li> <li class="item">yes</li> <li> <ul> <li class="item">no</li> </ul> </li> </ul> Assuming I have the outer <ul> in $ul. How do I get the two immediate children which have the item-class? In jQuery I would write something like this: $ul.children...

How can I know if an element is a direct child of the body using jQuery

I want to perform some action on elements that are not direct child of the body. How can I check a particular element to know whether its partent is the body. Thanks! ...

Finding a particular parent of an HTML DOM element

Lets say I have the following: <table><tr><td> <table> <!-- I want a reference to this table --> <tr> <td> <table> <tr><td><span class="theSpanClass"></span></td></tr> </table> </td> </tr> </table> </td></tr></table> Using jQuery, I'd ...

A recursive method to traverse a multi-dimensional array in PHP

I need a method to traverse a multidimensional array in PHP without using function calls itself. Basically I have an array like this: $data = array( 'hoge' => 123, 'foo' => 456, 'bar' => 789, 'aaa' => array( 'abc' => 111, 'bcd' => 222, 'cde' => 333 ), 'bbb' => array( 'def' => arra...

Customizing jQuery validate to pop-up error message over an icon

Hello! This might be a fundamental jQuery misunderstanding but I've got to ask... I'm trying to get the jQuery.validate to display its error messages on qTip, a jQuery plugin for customizing tooltips. Specifically I want to get the tooltip to pop-up on mouseover of a little red "X" icon. I can get the tooltip to popup over the form f...

Any tricks to finding a lost jQuery object?

Hi stack folk! I'm working with jQuery.validate. One of its options is "success" where a function can be called upon valid user entry on a form. The only argument that can be passed is "label" which (as I understand) is a dynamically added label field to the right of the input element. I need to perform a series of actions on a sib...

Python; Linked list and traversing!

Hi! Starting some programming with python at school now, and I don't know how to proceed with this problem. Any thoughts? Input consists of integer separated by line breaks. Your program should submit them in a linked list, traverse the linked list and print the highest number. Something to take the first number, and do an action whic...

jQuery traversing elements get all previous elements that match selector

I have a collection of divs that contain either images or checkboxes. My end goal is to have the onclick event on the checkbox also check all previous checkboxes. Here is my layout (dynamically created so id #'s can change based on page load data): <div id="Main1"> <div id="Secondary1"> <div id="div1"> <im...

jQuery move list item to end of list

I have this list that can be sorted with sortable. How can I move the li item with class .neutral to the end of the list when sorting is finished? $(".thumbs").sortable({ stop: function(event, ui) { // move .neutral at the end of this list } }); <ul class="thumbs"> <li>red</li> <li>green</li> <li class="neu...

relative path traversing, is this valid?

I have a an XML file where I need to get up 2 dirs to get a file (from water to fire) <album basepath="albums/water/images"> <img src="001.jpg" /> <img src="002.jpg" /> <img src="../../fire/images/005.jpg" /> </album> So my question is if albums/water/images/../../fire/images/005.jpg is a valid path? ...

JQuery parentsUntil with element as variable not working as expected.

My problem is best explained with examples: This works: $(startContainer).parents().each(function(index, parentNode) { if (parentNode.isSameNode(commonContainer)) return false; console.log("start vert struc: " + parentNode.nodeName); }); While, this does not work: $(startContainer).parentsUntil(commonContainer).each(function...