JQuery :: Get ID's Of Children Div's Of A Class With A Specific Parent Div ID?
Mar 8, 2011
I'm building a volunteer translation site. In order to constantly update only paragraphs that multiple translators are working on, I need to pass an array to PHP of A: which paragraphs are open, and B: which translations have been submitted and are visible on the user's screen. PHP will then compare this with what is in the database and tell jQuery to add new submitted translation paragraphs or remove deleted ones.I've managed to make a string of all the open Div's and have it updated every second, like this:
function cycle(){
var data = '';
$('.paragraphtobetranslated:visible').each(function(){
[code]....
View 2 Replies
ADVERTISEMENT
Oct 28, 2010
I have:
<dt><a href="javascript:void(0);">Menu 1</a>
<dd>
<....>
[code]....
View 1 Replies
View Related
Apr 21, 2010
I have the following scenario(well the structure is the same):
<fieldset id="fs"><p><select id="sl" runat="server" /></p></fieldset>
The name of the fieldset is constant but the name of the select is generated via asp.net thus i do not know the final id on that element. I can call on the select by using $("[id$='sl']").change() which works. But its a bad solution because I need to be sure that I only trigger the element under the fieldset "fs".
$("#fs").children().change()
Works as well but i obviously I am looking for a way to target only that select element under only that fieldset.
View 2 Replies
View Related
Mar 10, 2010
<div class="box top"></div>
<div class="box main">
<div class="box header">
<div class="badge"><ul><li class="active"><span>60</span></li></ul></div>
[Code]....
What is happening is $(this) is no longer based on .expand being the (this) that is clicked.
like if i have a button SOMEWHERE randomly on the page with this
<div onclick="Minimize('_alerts');">Click Here</div> this will minimize alerts but because the (this) in minimize function doesn't actually point to the right button that I want to add a class to.
Is there a way to modify the minimize function so that it finds the <div id="mytoggle"><ul> <li class="expand boxminimize" rel="_alerts"> using the rel toggle, and then changes the class of the li from expand boxminimize to boxexpanded??
just like the .expand click function I posted on the top of the post that works?
View 1 Replies
View Related
May 3, 2010
I need to select the last children of parent elements
For example
<ul>
<li></li> <-This will have the background #1a
<li></li> <-This will have the background #1a
<li><ul>
[Code]....
So I would need the last children. If there is no nested element then that is considered the last child. I have to write a jquery script to apply a background to the last children. A nested element can have a nested element and then that element's children will be considered the last ones so they will get the background but not the parents of those children. If the item has no children then that item will have a background.
So there are 3 different backgrounds. Each letter a, b c will represent a lighter tone compared to the previous color. C is lighter than B, B is lighter than A etc. So this will have to be a "smart" system in which the ul li will be updated and depending if it is the last one inhierarchyit will not have the arrow.
View 5 Replies
View Related
Jul 27, 2010
I'm trying to manipulate items in a table using jQuery, using the parent() and children() methods of the "this" object. I think I'm not understanding how to use the parent and children methods correctly.
What I want the code to do is to show the list and button within the <td></td> when clicked on, and then hide it when the newly shown button appears.
[Code]...
View 5 Replies
View Related
Apr 27, 2011
I have something like that
<li>My menu item
<ul>
<li>my submenu item</i>
<li>my submenu item</i>
[Code]...
The problem is that when the mouse goes from the main <li> to the children <li> a mouseout event is generated from the main li.
My idea is that if I can detect that the the mouseout is happening at a child of my main <li> then I should be able to stop the handler with an "if" or something.
View 1 Replies
View Related
Feb 7, 2011
Right now I am adding a click function to a div element on the page, it triggers a slideDown() animation. I would like it so when the user clicks on an 'a' link inside the div it does not cause the animation.
Currently it triggers the animation because the 'a' is inside the div that I have a click event for.
I tried checking inside the click function for my div element to see if 'this.tagName == 'A'' but it always says DIV, even when I click on the link.
I also tried adding a click event to all the links that stops any animations, but for some reason its not stopping the animation.[code]...
View 2 Replies
View Related
Sep 23, 2009
Is it possible to 'deactivate'/nullify a top-level link in an unordered list if child links exist in that list?
For example, I have the following:
And I want to knock out Link 4 because it has sub-items. Is that possible?
View 2 Replies
View Related
Jan 25, 2011
The following function works fine. I was just wondering if there are any serious negatives to using so many parent, sibling and children type functions?
View 1 Replies
View Related
Oct 29, 2009
I am manipulating a style on elements with class="House" or "Senate." Unfortunately, it sets the style for every child underneath. [code]...
View 7 Replies
View Related
Mar 1, 2011
Think how twitter appends a chunk of list items to the end of the list when you load more results. I'm trying to achieve the same thing without replacing the entire parent with the same content each time 'appendRows1()'
The function needs to support any type of content - the children could be tr's li's etc.[code]...
View 3 Replies
View Related
Dec 28, 2010
integrating PHP-HTML-JS I'd need some help for doing the following:I have a index.php including:
<script type="text/javascript">
function filter (phrase, _id){
var words = phrase.value.toLowerCase().split(" ");
[code]....
and a child.php including a table object with the id LIST.I'd need to change the parent.php in order to filter on real-time the table LIST via the FILT input on the parent form. I have tried different values instead of 'this' on the js function calling but nothing succesfully.
View 1 Replies
View Related
May 9, 2010
Suppose I have the following HTML code:
<div class="one">
<a href="http://jquery.com/">jQuery</a>
</div>
<div class="two">
[Code].....
Basically I want to recognize which <div> tag was double clicked, and hide the corresponding link that is nested within that specific <div> tag.
The only way I can think to do this currently is to basically copy and paste a whole bunch of jQuery code for each <div> tag and it's sub-elements (links in this case).
View 2 Replies
View Related
Jun 11, 2009
I'm a novice here, and I've got such a piece of code:
$(document).ready(function() {
$.each(includes, function(index, value) {
$('ul#menu-list').append('<li id="' + index + '"><a href="#">' + value + '</a></li>');
[Code]....
Basically, I load an html document on demand, through a menu populated with 'includes' values. Clicking on any item on the menu will load the appropriate document in the #content div and add an 'active' class to the menu item itself, to highlight it.
The loaded document optionally has inline links, that should load documents based on the same id's. Clicking on these inline links loads the appropriate document, but the 'active' class won't be added to the menu item having the same id of the inline link.
The thing I don't understand is that if I put (look at the line with arrows) any other value than 'id' (any valid integer or even 'id * 2') I get the desired result: a menu item having that id gets highlighted, a class being added to it.
View 3 Replies
View Related
May 14, 2009
My question is quite simple with an example:
[Code]...
View 1 Replies
View Related
Sep 24, 2010
I've got a list of modules, and when I click on one of them it expands displaying the content. When you expand them, a little image on the right changes from a down arrow (v) to an up arrow (^), but it's changing on all of the modules rather than just the one.
Here is the website: [URL]
It's pretty obvious what my question is; how do I get it so the image only changes on the module that you expand?
Here's the code for the moduleToggle function:
function moduleToggle() {
$('.content').hide();
$('.title').click(function() {
[Code]....
View 3 Replies
View Related
Jan 23, 2011
I have several table rows with the class name "recs", each containing a cell with the class name "data".Now I want to copy the text inside the table cell into a text box whenever I click on each row. For example if I click on the second table row, the name "David" would be copied in the textbox "name"
[Code]...
View 1 Replies
View Related
Jan 10, 2011
I have a div with several classes on, like this:
<div class="class-one class-two special-class"></div>
I want to get the class that starts with 'special' and store it in a variable...but I am having trouble doing this...I can get as far as storing all of the classes in a variable:
var myClasses = $(this).attr('class');
...but I now need to extract just the one class that starts with 'special'...
View 4 Replies
View Related
Dec 3, 2011
I'm trying to set up a simple load function to bring in some specific class content from pgB into pgA.Here's the code in html in pgA:
<div id="bext"></div>
<script type="text/javascript">
var $j = jQuery.noConflict();
[code].....
View 30 Replies
View Related
Jul 18, 2010
How is it possible to get the class starting by 'date' of a specific element?
e.g. <p class="hello date123 world"></p>
I would like to get the class date123
View 5 Replies
View Related
Sep 23, 2010
I have a list of links in a sidebar, each with an associated class name. When one of these links are clicked, I want to fade out all of the main content list items that do NOT have this class (ie - if I click on boots, I want to fade out the list items heels and sandals)
[Code]...
View 4 Replies
View Related
Oct 10, 2010
I've got a list similar to the following [code]...
I'm new to this jquery malarkey so I'm shooting in the dark somewhat here.
View 8 Replies
View Related
Nov 17, 2011
I have a large number of "li"s with the same class - i.e;
<li class="month01Days"></li>
:
:
[code]....
View 1 Replies
View Related
Nov 6, 2010
On my website I have a lot of entries which are similar to blog-entries. Every single entry has about 500 signs and if there are more than there is supposed to be a button "read further"(atm there is no button but later it will be). If the user click this button, the remaining text of the entry is supposed to slide down. My problem is now that I don't know how to slide down just one article. Every article looks like this:
<article class="dark">
<div class="text"><h2>Title</h2> .....
<div class="slide_text"> .....
</div></div>
</article>
But how to slide down only the "slide_text" which belongs to the clicked article. If I use:
$('article').click(function() {
$('.slide_text').slideToggle(200);
});
Every singe "slide_text" of all the entries appears. But this is not, what I want. Is there a way to toggle just the child-slide_text of one entry? Or do I have to give every entry an id to define which entry is supposed to toggle?
View 1 Replies
View Related
May 27, 2010
why I'm not able to remove the class "hasLink" from the parent element that contains the class ".test"
<ul>
<li class="hasLink">
<div>
<a href=" class="link">link</a>
[Code]....
View 2 Replies
View Related