JQuery :: Have Parent 'div' Trigger Animation But Not Children 'a' Links?
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
ADVERTISEMENT
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
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
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
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
Feb 4, 2010
I have this structure:
Index.html:
<html>
<head>
<script src="jquery-1.3.2.min.js"></script>
[Code].....
This is does not work, how I can send trigger event from iframe to parent window?
View 12 Replies
View Related
Aug 18, 2011
I need to click on a child element and trigger an function in the parent, but know when i enable it both child and parent are getting executed.As you see in the attachment photo when I click the flip page icon the T-shirt should hide and create a description on T-shirt.
View 3 Replies
View Related
Mar 31, 2011
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]....
View 7 Replies
View Related
Jul 11, 2010
I made the following, but wanted the user action to update the audio player status without a page refresh. Currently, the code opens another page with just the player and plays the track picked. How could I make this so only the player src="" changes and nothing else.
Code:
<!DOCTYPE HTML>
<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>HTML5 Audio Test</title>
<script type="text/javascript">
[Code]....
View 2 Replies
View Related
Jan 9, 2010
Is it possible to trigger a function in a parent page from a window spawned from that page?
View 3 Replies
View Related
Mar 3, 2011
I'm new to jQuery and Javascript overall, I have searched the internet to make use of jQuery instead of the HTML's iframe tag. My problem is links inside a .load file, I want them to refresh the box on the index.php file, not the file itself (in this case the links are in blog.php)
Here's everything I can provide with:
Files:
"index.php"
"blog.php"
In my index.php file I have this script to make my index.php links open the required file in my div box.
"index.php"
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#html").load("blog.php"); // shows the blog.php when I first enter index.php, which I want to have
$(".link_click").click(function(){
$("#html").load($(this).attr("id"));
});
});
</script>
Here's "index.php" link:
<a class="link_click" id="blog.php">Blog</a>
Here's my div box in "index.php" where I show the information within the loaded file:
<div id="html"></div>
All this works, but here's my problem, I have multiple links within "blog.php" which I want to make "index.php" to refresh the "index.php"'s html div. Is there some kind of way to edit the "blog.php"'s script to make it "index.php" the parent or reference?
"blog.php"
<script type="text/javascript">
$(document).ready(function(){
$(".link_click").click(function(){
$("#html").load($(this).attr("id"));
// Need to change this(?) to make it reference the index.php's html div box
});
});
</script>
View 2 Replies
View Related
Oct 25, 2010
Have this in parent document:
function ResizeDocument(...) {
$("iframe"
).each(function
(){ $(this
.contentWindow.document).trigger('customresize'
,null
);});
[Code]...
View 2 Replies
View Related
Jan 4, 2011
Ok so I have a site that I want to automatically close the window when the focus is lost from the page. For example, if the user clicks off the page to something else on there desktop I want the page to close. So far I have managed to do this but the grids on my page and the scroll bars all trigger the close function when clicked on. Is there anyway to make the scroll bars and drop down boxes not trigger the function?
This is the code I have so far.
View 6 Replies
View Related
Dec 2, 2010
I have a parent div, that when hovered over changes the background color.There is a onclick event so that a user can click anywhere within the div for the link to work.Inside that div I have another div with unique links. When I click on any of those links, it also activates the other onclick event. I don't want this.Here is my code
<div class="cat1" onmouseover="style.backgroundColor='#09F'; this.style.cursor='pointer';" onmouseout="style.backgroundColor='';" OnMouseUp="location.href='http://a.com/details.php?id=305366';">
<div class="itemwrapper">[code].....
I'm guessing I need to create some type of function that will detect where the click came from and then decide whether to fire it or not?
View 2 Replies
View Related
Jun 25, 2009
Put a link on my page that will open an external site (over which I have no control) in a pop-up window. When the user closes the pop-up, I want my original page to redirect to another page. The difficulty I'm having is that I can't add any code to the page in the pop-up as it's not my site.
View 4 Replies
View Related
Dec 2, 2010
I wanna implement a button that shows the context menu. I already implemented[URL].. I am now searching for hours about those 2 terms but have not found an answer yet. Also tried to trigger it myself but had no success yet.
View 1 Replies
View Related
Jan 10, 2012
I have a button which is animated with a rollover effect, obtained through jQuery of course. I wish to open a lightbox clicking that button and I tried with a simple, self-made lightbox and with FancyBox but in either case the lightbox is displayed without animation.I post the code for my buttons and the lightboxHTML for buttons:
<ul> <li><div id="fader0"> <div class="from"><a class="products" href="#inline"><img src="images/tabproducts.png" alt="Our products" /></a></div> <div class="to"><a class="products" href="#inline"><img src="images/tabproductsHover.png" alt="Our products"
[code]....
View 1 Replies
View Related
Apr 30, 2010
I am new to jquery, and love it so far, but I am more of a designer, not a developer. I am learning jquery to enhance my sites, and I am having a problem figuring out buttons.
I have them working in firefox and safari, but in IE links do not work.
Here is the script I have, and the button code.
View 1 Replies
View Related
Aug 26, 2009
My menu navigation(Home, Hosting Solution, etc..)
1. The submenu links need to be centered in the middle of the div instead of aligned to the left.
2. Can the submenu links have a rounded box appear under them, instead of being underlined links. Like these at the top: [url]
3: The top tab needs to stay gray/active/on when the mouse is moved down to the submenu or when it is the active button.
Here is the link of the site [url]
View 2 Replies
View Related
Mar 10, 2010
I'm using jquery/ajax to create some links with window.open method. Here's the relevant code:
$("#content").empty();
$.ajax({
type: "GET",[code]..........
Basically, when you click a link a function is called with a parameter based on the particular link you run. Then the code runs through an xml file, and if the parent of the nodes I've cyling through has a value equal to the parameter past to the function, that node is used to create a new link with window.open function attached to it.It all works, or seems to, and when I alert what is being built, it looks right to me, yet the links don't work.I've attached a copy of one of the alerts of one of the links as it's built.
View 5 Replies
View Related
Aug 27, 2011
I've been messing with this code to make a fade in animation with setTimout. The only thing is addition isn't working on the fade in. A subtraction on a negative works though. This seems strange to me.
changeit.style.opacity -= -0.01; works but when it's changed to changeit.style.opacity += 0.01; there's no fade in. It's the only thing I change. My intuition says to me it should work with addition, but maybe there's something I'm not understanding.
<html>
changeit.style.opacity -= -0.01; if this is set to changeit.style.opacity += 0.01; it doesn't work. What?
Of course this is all just for Firefox for now. If I put this in something useful I'll change it so it'll work in other browsers later.
View 8 Replies
View Related
Nov 28, 2010
I have an image wrapped inside a link tag.<a href="somepage.html"><img id="content" src="img/some.gif" /></a>
I want this .click target to be the link: $('a').click(function(e){
Instead, the target returned is the image [HTMLImageElement].
I have tried using closest()and currentTarget:
But they all still return the image, not the link.
View 2 Replies
View Related