JQuery :: :not Targeting A Child Element Not Working Correctly?
Nov 17, 2011
I'm trying to use a :not statement, so if you click anywhere else on the page BUT the element in the :not a div will disappear. When i use the same statement without the not, it works fine (click that one element and the div in the function hides).I'm assuming that the :not statement isn't working because the element is a child of its parent, so when you click it, essentially you are still clicking the parent which isn't included in the :not.
j(':not(.arrow)').live('click', function(e) {
j('.label').hide();
});
View 9 Replies
ADVERTISEMENT
Jun 13, 2009
I'm customizing the cycle plugin a bit from [URL] , which slides through a number of items.The issue I have is selecting a child object, to get its 'alt' attribute, and display it as a description. Using the default example:
function onBefore() {
$('#output').html("Scrolling image:<br>" + this.alt );
}
...works great when each item is an image. But I need to link each element, so my markup looks like this:
<div id="slideshow1" class="pics">
<a href="portfolio.html" title="Go to Project"><img src="tree.jpg" width="200" height="200" class="featuredimage" alt="Tree Branches" /></a>
[code]....
I'm not sure how to get the child element's alt attribute. I've searched through jQuery documentation and googled around, but can't get it working.
View 1 Replies
View Related
May 13, 2010
I wrote code to resize a div element.The main aim is to resize the div element from any direction. But it is not working correctly in Mozilla. Even in IE it is working fine only if the mouse is dragged slowly. If we drag the mouse fast it is loosing the control. Are there any browser issues to be fixed. Please check it. I'm including the file.
Code:
========================HTML File============================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>[code]..........
View 3 Replies
View Related
Oct 4, 2010
i have a menu generated by a list with nested lists. i want the parent link to stay highlighted when the mouse hovers over the sub menus. because those sub menus are also generated by jquery (qtip), CSS alone won't do it (triedul.topnav li:hover a {background-color: #F00;}).is there a way to do this using jquery?
View 15 Replies
View Related
Mar 4, 2010
I would like somebody to tell me wich is the correct way to add an element to another, and then give the added element a class ??
[Code]...
View 4 Replies
View Related
Mar 28, 2011
I have a function with the following code:
function saveRecord(){
$("#weekSheet tbody tr").each(function(){
$('td').each(function(i,o){
[code]....
View 4 Replies
View Related
Feb 10, 2010
$j('div.LeftNavArrowRt').parent().hover(
function() {
var selector = ".sub_" + $j(this).attr('id');
[code]....
View 3 Replies
View Related
Sep 28, 2010
http://facetofacetutoring.com/navtest/ogs_nav.htmlGo to the products link...
View 1 Replies
View Related
May 10, 2009
The following method below seems to behave unexpectedly under certain conditions.
$('#myDiv').empty().append(someText); I beleive, (imho), that the empty() function requires some time to execute and interferes with the append() function. I say this because adding a setTimeout() to delay the append() will correct the eratic behaviour.
[Code]...
View 2 Replies
View Related
May 12, 2009
I have this snippet:
[Code]...
that is sent when a very simple form (one value and button) is sent. The thing is, it works on my local webserver, but when I upload it to my webhost, it wont work. It works if add data.php?nick=Test, then the
data will be added into my database but not when called from .ajax.
View 9 Replies
View Related
Feb 15, 2011
I added a jquery megamenu to my site, but now my thichbox script is not working correctly.trying to get it to work. I added a noconflict statement and changed $ to jQuery in my jquery.js file, but it is still not working correctly.
http:[url]....
--------------------------
<script type="text/javascript" src="http://homecomforts.com/js/jquery.js"></script>
<script type="text/javascript" src="http://homecomforts.com/js/thickbox.js"></script>
<script> [code]......
View 1 Replies
View Related
Jul 15, 2009
I want to use the Ajaxify-Plugin ( URL... ) for my new Website. It fits exactly my needs.Sadly the animations are not working correctly.When your Internet-connection is too fast, you don't see animations at all (on a local machine also). I putted up a demo: URL...The content is supposed to fade out, then the new content gets loaded and then this new content should fade in nicely again, like in my own example, which I got from a tutorial that is just using pure jQuery resources: URL... [code]
The author of the plugin himself is using a server delay to overcome the sideeffect ( URL... - click some links under "New v2 features"), but i think that's the wrong way to go for production.Sadly im not good enough in JavaScript-programming to tweak the plugin by myself, to get it to work like in the second example... I tried it now for 6 hours.I would really like to use Ajaxify, because it has all the features I need united in it. The only thing that is not working are this animations.
View 1 Replies
View Related
Mar 16, 2010
The bit of code in bold in the code below is giving me this error in IE: Error: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; Tablet PC 2.0; InfoPath.2; OfficeLiveConnector.1.4; .NET CLR 3.0.30729; OfficeLivePatch.1.3; MSN OptimizedIE8;ENGB)Timestamp: Tue, 16 Mar 2010 15:07:11 UTC Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
[Code]....
View 1 Replies
View Related
Jul 30, 2010
All the code in my $(document).ready function is processing correctly, except for the .trigger() statement below:
$('.content-btn:nth-child(3) a').triggerHandler('click');
I've tried triggerHandler() and trigger() both, and the command runs fine if called from another event handler—the click event for that <a> works as desired.Console shows no errors, and as I said the other lines in (document).ready work fine, it's just this one thing that doesn't seem to run.
why would this command not process on (document).ready?
View 2 Replies
View Related
Aug 26, 2010
I have a javascript here for adding my div element to my registration form,Adding the div element is easy, but it shows on the bottom of my form. I cant make it as the first child element of my form...This is my code
var _form = document.getElementById('registration_form');
var errorDiv = document.createElement('div');
errorDiv.setAttribute('class', 'confBox');
[code]....
View 2 Replies
View Related
Apr 24, 2009
I've got a reference to a TableCell and I'd like to use jQuery to get the first instance of an <IMG> tag within that TableCell, but can't get the syntax right, I understand how it would work if I were to reference the TableCell by and ID or class, but not when I have a direct reference to the cell, I've got:
What the jQuery syntax should be to get the first img tag within "tdRef"?
View 2 Replies
View Related
Apr 4, 2011
I'm using the following code that adds to <a> tags to each <td> inside a table.
$(document).ready(function() {
$('.calendar td:not(.notinmonth.)').each(function() {
$(this).append('<a href="#" class="available am">AM: Available</a>').append('<a href="#" class="available pm">PM: Available</a>');
});
$('.calendar td:not(.notinmonth.)').each(function() {
$(this).has('.event').remove('.am');
});
});
The second half of the code looks to see if any of the cells contain an element with class 'event'. If one exists, then the '.am' anchor should be removed. However this does not appear to be happening. After carrying out a few tests with the 'alert' function, it looks as though the script thinks that every cell contains a '.event' element, but I have no idea why! Not only that, it doesn't remove the '.am' link from any of them.
Here is the markup for the table (the cell with 'Day 9' in it is the only one that should match having an '.event' element:
<table class="calendar"><thead>
<tr><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th>
<th class="weekend">Sat</th><th class="weekend">Sun</th></tr>
</thead><tbody>
<tr><td class="notinmonth"></td><td class="notinmonth"> .....
View 2 Replies
View Related
May 26, 2009
Simple stuff here
My HTML is like this:
<div class="feature">
<h2>Heading Goes Here</h2>
<img src="photo.jpg" />
[Code]....
What I want to happen is for the element inside the .feature class to appear when the <h2> of that <div> is clicked I tried using next() and a few other methods but it doesn't work as neatly as I want it to - how can I tell jQuery to just return the element within that div (and not all elements which are inside a .feature class)?
View 2 Replies
View Related
Sep 2, 2009
I've 2 field sets and a div inside each fieldset with some contents. When the legend of the current fieldset is clicked, I will toggle the div contents. I'm trying to write a generic function which can be used by everyone. Here is my design:
<fieldset id="fs1">
<legend id="leg1">First Legend</legend>
<div id="div1">
[code]....
View 10 Replies
View Related
Jul 2, 2009
I have the usual unordered list for a navigation menu with submenus...
html:
<ul>
<li><a href="#">Link 1</a></li>
<li>
[code].....
All of the links inside of the parent <li> have a border radius. But if the parent <li> has a child <ul>, I don't want the link to have a radius.I'm currently using this jQuery:
<script>
$("li").has("ul").addClass("sub-radius");
</script>
It works fine except it's targeting the <li>, but I need it to target the child <a> and remove its radius.
View 1 Replies
View Related
Dec 16, 2011
On the treeview "Large Tree Demo" page, when "Expanding All" the links at the bottom of the page are not displayed correctly. Some of the links don't connect to the parent nodes. I have tried this using IE8 and Firefix8 with the same results. Can this be fixed ?
View 5 Replies
View Related
Jul 30, 2010
please see the code below.at the moment, when you click img, click eventtriggeredbecause parent element has click event.I want click event not to be triggered when you click img.How would I do that?
$("#click1").click(function(){
alert('Clicked.');
});
[code]....
View 2 Replies
View Related
Sep 30, 2011
i am working with opacity. i dont want to include child tr with the table element opacity.
View 1 Replies
View Related
Feb 2, 2010
I'm trying to add a click listener to a list element that has a hidden unordered list.
<script type="text/javascript">
$(function(){
$('li:has(ul)').click(function(event)
{
[Code]....
Basically, I'm looking for a way to find a list element that has a ul child, and then hide or show that ul. What I have here doesn't seem to be working.
View 2 Replies
View Related
Jul 29, 2009
How can I pick an id element (here #bridge1,#bridge2) and toggle its child (here a p element) without actually using the id element as parent?
'this > p' apparently does not work.
$('#bridge1,#bridge2').click(function(){
$('this > p').toggle();
return false;
});
View 3 Replies
View Related
Oct 22, 2010
I was wondering if there is a "selector construct" that matches an element having more than one child. So I'm looking for a solution that doesn't need
an if statement such as;
if($('ul').children().size()>1)
{
//do this
}
[Code]....
But I'm looking for a selector that already looks for these conditions. Kind of like how :has() works but then a check for more than one child.
View 2 Replies
View Related