JQuery :: Get ID Of A Clicked Parent ID?
Mar 14, 2010Get ID of a clicked parent ID?
[Code]...
Get ID of a clicked parent ID?
[Code]...
Not really sure how the best way to start explaining this, but I have a small script set up that activates a second section to an accordion to display information. The idea is that a table cell will be clicked and then the second according will activate displaying information relating to the cell that was clicked in accordion part 1.
I have managed to get it to update coding in the var's by hand, now I want to be able to get certain bits of information from a nested div that is hidden in the table cell (I know, very messy - but it will all be made a little less messy in the future when I have got the process correct).
[Code]...
I have a menu as follows
<ul id="nav">
<li> <a href="#">Golf</a>
<ul class="golf">
<li class="engine"><a href="#">Engine</a></li>
<li class="brakes"><a href="#">Brakes</a></li>
<li class="transmission"><a href="#">Transmission</a></li>
<li class="interior"><a href="#">Interior</a></li>
<li class="running_gear"><a href="#">Running Gear</a></li>
</ul></li>
<li><a href="#">Polo</a>
<ul class="polo">
<li class="engine"><a href="#">Engine</a></li>
<li class="brakes"><a href="#">Brakes</a></li>
<li class="transmission"><a href="#">Transmission</a></li>
<li class="interior"><a href="#">Interior</a></li>
<li class="running_gear"><a href="#">Running Gear</a></li>
</ul></li>
<li><a href="#">Passat</a>
<ul class="passat">
<li class="engine"><a href="#">Engine</a></li>
<li class="brakes"><a href="#">Brakes</a></li>
<li class="transmission"><a href="#">Transmission</a></li>
<li class="interior"><a href="#">Interior</a></li>
<li class="running_gear"><a href="#">Running Gear</a></li>
</ul></li>
<li><a href="#">Jetta</a>
<ul class="jetta">
<li class="engine"><a href="#">Engine</a></li>
<li class="brakes"><a href="#">Brakes</a></li>
<li class="transmission"><a href="#">Transmission</a></li>
<li class="interior"><a href="#">Interior</a></li>
<li class="running_gear"><a href="#">Running Gear</a></li>
</ul></li></ul>
I want to post the class of the parent ul and the clicked li to php when they are clicked say as "model" and "part". I'm sure its simple but i cant seem to quite grasp how to do it.
I have a list of divs that each look like this (simplified):
<div id="property1" class="property cms-repeat"> <h4>Property 1 - <span class="location cms-editable">location3</span></h4> <p><span class="download">Request a copy of the full property details <a href="#" title="Request property details" class="request"
[code]....
I have an <input type="checkbox"> whose immediate parent is an <a> tag. The <a> is significantly larger than the <input>.
I want the checkbox to toggle on/offwhether the <a> is clicked or the checkbox itself. I also wantto store the value of the checkbox after it changes.
This sounds simple butI'm having trouble with the event bubbling (as in, I don't understand it).
Here is my current code.
HTML:
I want the <a/> in an <li/> to be triggered when the click happens anywhere within the </li>. So given the html...
<ul>
<li><a href="javascript:alert('clicked!')">test</a> <span>some other stuff</span></li>
<li><a href="javascript:alert('clicked!')">test</a> <span>some other
[Code]....
I have several divs that each have a certain link. How can I make sure that when a link is clicked that it will only change elements that are within it's parent div and not the others?
View 1 Replies View RelatedI have a javascript for a tree view but i need to change it according to the requirement. Lets start with example with the treeview as follow:
1 Door phone
1.1 Ready Kits
1.1.1 Audioset
1.1.2 Videoset
[Code]....
Now the thing is in the current treeview a single category is open at a time. like if 1.1.1 is open 1.1.2 will b closed and similarly if 1.1 is open...1.2 will b closed. But i want that when i click on 1(Door phone) ie Door phone...evry node should be opened instead of just one similary when i click on 2(CCTV), all its node should be opened.
Demonstration page: [url]
Adjust the CSS margins of the BODY element with the first slider. The yellow P (paragraph) element resizes to fit its smaller containing block, as I would expect.
Then, adjust the CSS border or padding of the BODY element with the second and third sliders. The P element does not resize, though its origin changes. Instead, it overflows its containing block.
Finally, adjust the margins again. The P element snaps back into its containing block.
As you can see from the source, this is jQuery 1.6.4 and jQueryUI 1.8 pulled from googleapis.com.
Edit: Client is Google Chrome16.0.889.0 dev-m.
[URL]..Default.aspx I have both a carousel with images andalso animagemap(notnot published yet)with coords that when clicked i want to write to a cookie file which image or image map coordinate was clicked, so when they are hyperlinked to the next page the correct div opens based on first reading the cookie written to on the previous page. Anybody have a basic script for reading and writing to a cookie using jquery in this fashion?
View 2 Replies View Relatedhow to keep the clicked area selected until another area is clicked.
View 8 Replies View Related<script language="JavaScript">
function changeColor(cell_id){var state1="#dde6ed"; var state2="#ffc20e"; var cellid = new Array ("id1", "id2", "id3", "id4", "id5", "id6"); for(var i = 0; i < cellid.length; i++){var nav = document.getElementById(cellid[i]); if(cellid == nav.id){nav.style.backgroundColor=state2;} else {nav.style.backgroundColor=state1;}}}
</script>
what is wrong with this script. I put an onClick= changeColor(this);" in my <td> tag to call the script but still not working.
I have a page which has a form and also one iframe in the same. there is a button on the parent form.when the button is clicked, i am submitting the iframe and parent both. forms are getting submitted. but when i do print_r for iframe values, it is blank
[Code]...
When checkbox is clicked email is necessary and if checkbox is not clicked email is not necessary for submitting a button give me the code:
View 1 Replies View RelatedIm trying to build on a script that I found on the internet and modified to my needs.urrently there are three images on the left, which, when clicked, change the image on the right depending on which of the left images was clicked.Simply, when you click the whisky link on the left you see a bottle of wiskey on the right. Here is my script:
Code:
<SCRIPT TYPE="text/javascript">
function switchImg(i){
[code]....
I have a very simple web page that is comprised of the same image over and over again. I have it to when you click on it, it swaps the image out and adds 1 to the counter. I need it to subtract 1 when you click it again.
<script type="text/javascript">
var namesVec = new Array("block.png", "block_hover.png");
var root='images/';
function swapImg(ima){
// divides the path
nr = ima.getAttribute('src').split('/');
// gets the last part of path, ie name
[Code]...
I mean, is there a way to assign "add 1 when clicked" or "subtract 1 when clicked" to image properties?
I have a page. In that page is an iframe, lets name it 'A'. inside A there is another iframe 'B'. there is a link on that page which on click opens a popup. In that pop up, there is actually a document upload facility. Now i want that after every upload (onSubmit), iframe A should refresh.
have done it many times but today its not working.
function validate() {
(window.parent.opener.location.href)=(window.parent.opener.location.href);
window.parent.opener.location.reload(true);// this is tried as well
}
Basically I have a whole heap of div's (class="folder") that are generated dynamically. What I want to do is click on any one of those div's and it loads a dialog that contains more information about the clicked folder.
I have this to handle the click event on the folders..
and this for the actual dialog [code]...
I'm using the top z-index plugin which works fine using this:
*$("#name").click(function(){
$("#name2").topZIndex();
});
However, I have many divs on the page that act as triggers for the divs that have their z-index changed and I'm trying to write a function that will work for for them all.All of the triggers have the same class "trigger", they all each have their own id. Each of these triggers has a corresponding div which is targeted using the plugin, these have the same id as the trigger with the addition of the number "2" after them.So for example the trigger div <div class="trigger" id="name"> is clicked to change the z-index of the corresponding div <div id="name2">.In theory I could write a function that says when any div with the class of trigger is clicked, get the id of this div, then change the z-index of the div that has the same id but also with the suffix of "2".I've tried to write this myself but can't get it to work.I'm guessing it might start something like this:
$(".trigger").click(function(){
var currentId = $(this).attr('id');
$(document).ready(function(){
$(".button").click(function () {
$.ajax({
[Code].....
This doesn't work. How to get the id of the .button where .button is <div>.
I've done this before but the whole idea of it is completely escaping me right now.Here's what I'm after.
$("img").click(function() {
var source = (the image's src)
});
I have a func:
$('div.tabnav ul.tabNavigation a').click(function () {
this.hash e.t.c
//Is there a way to find out the name of the div or jquery id that was clicked. E.G so I can go ( in pseudo )
[Code].....
I have a listing of records on a page and an "Edit" button for each record. I want to write some jquery that fires when the button is
clicked to go to the edit page for the record whose button I clicked. Here is what I have.
<script type="text/javascript">
$(function() {
$('#myGroup input:button').click(function(e) {
[code]....
i can successfully bind click events to dynamically added checkboxes, butstuck on how to actually get the checkbox's id attribute out.
<
script
language
=
[Code]....
I have a hidden DIV, which is going to cover all of the screen as part of a lightbox. I wrote my code based on what I found at [URL]. When I click on the link to run the lightbox, the div isn't showing even through the z-index is the highest on the page. I've also tried seeing if it was a corrupted version of jQuery.
<style type="text/css">
#video1
{
position:absolute;
top:350px;
[Code]....
i have function appended to a click event of more than one objects. How can i check if the object that was clicked has a certain class xy?
var t = jQuery(this);
jQuery(t.children()).click(function(e) {
if (??check if the element that was clicked has class xy??){}
}