JQuery :: Include Child Element Opacity?
Sep 30, 2011i am working with opacity. i dont want to include child tr with the table element opacity.
View 1 Repliesi am working with opacity. i dont want to include child tr with the table element opacity.
View 1 Repliesi 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 RelatedI recently wrote some code, which involves a list. Elements can be picked by up/down arrow keys.To highlight the elements, I'm using a similar call to objects[focus]stop (true,true).animate({'opacity': 1}, 200);(As you can see, all DOM elements are cached)the same call goes to the element which lost the focus, with an opacity value of 0.2.Whatsoever, I noticed on testing that the performance is just fine on firefox 2/3, IE 7/8, even Safari has good results.Only exception so far is Chrome, it's terribly slow on those calls with a CPU load of 40-50%.I didn't further investigate that behavior since it still works "OK" on Chrome, but SIGNIFICANT slower.
View 12 Replies View RelatedI would like to set opacity of some element to 0 through JavaScript, using GetElementById function. This is my short code inside body of HTML:
<script>
document.getElementById("element").style.opacity="0";
</script>
<div id="element">
noopacity
</div>
It doesn't seem to work, what am I doing wrong?
In order to design a custom select element look in my site, I was messing with the css and opacity value to fade the actual select box and put a background image in a div right above the select element. The functionality of the select box is preserved no matter if opacity is set to 0, so I was able to accomkplish my goal.But, that worked for every other browser around except IE6.Is there a please someone there that encountered this problem and possibly knows some kind of workaround?
View 2 Replies View RelatedThe 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]....
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]....
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"?
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"> .....
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)?
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]....
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.
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]....
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.
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;
});
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.
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.
i am curious if there is a simple solution to this very common problemim sure lots get.i have a div with some children items in it and when i fade one ofthem out the div jumps down to the appropriate height. i would like toknow is there a simple way to animate the div to shrink nicely insteadof just jumping to its new size?
View 2 Replies View RelatedI'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();
});
I'm using simple jQuery dropdown menu
Code:
<script type='text/javascript'>
jQuery(document).ready(function() {
jQuery("#dropmenu ul").css({display: "none"});
jQuery("#dropmenu li").hover(function(){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268);
},function(){
jQuery(this).find('ul:first').css({visibility: "hidden"});
});
});
</script>
What I need is: when someone clicks on submenu that element would be stay displayed under parent element.
How can I select an html element which has an id name that includes the dot "." character ? I need to include a id with nameweight.weight_7:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">$(document).ready(function(){
$("#weight.weight_7").click(function(){
[Code].....
I found this plugin is helpful,but has issue with ie 7,works in firefox What I want is that prepend and slide down effect,but there must be a table wrap the text. Here is my code
xml:
<taconite>
<beforeAndslide select="#example4">
<div id="ex1"><table><tr><td>some text</td></tr></table></div>
</beforeAndslide>
</taconite>
[Code]...
I created a dropdown menu using jquery. So when I hover over a button it slides down the menu. Now if I move the mouse out of the menu and bring it back in before it slides up(menu has a lot of items so there is enough time to bring the mouse back in on the menu)over the dropdown menu it starts a chain of slideDown() and slideUp() functions and it does not stop till I move the mouse of the menu or back on the button. Below is my jquery code:
[Code]...
How do I get the contents of an element in the opener and show them in the
child?
What I'm trying to do is something like this:
In the opener: <h1 id="pgtitle">Office XP</h1>
In the child:
function gt_pageCont () {
var pagetitle = window.opener.document.getElementById("pgtitle");
var pagetext = "<h1>""+title+""</h1><p>Here are some more info about ""
+title+ "".</p>";
document.write(pagetext);
}
and:
<body onload="gt_pageCont();">
I know that something is missing in the function, because I've tested it and
the child displays [Object] instead of "Office XP".
I have a function which looks like
function mainLeftElements(){
var containerDiv = document.getElementById('mainLeft');
var elems = containerDiv.childNodes;
alert(elems.length);
}
Which for a div declared like so:
<div id = 'mainLeft'></div>
Alerts me it has a length of 1, trying to work out what the element is (thinking it might be a blank text element or something, maybe the id attribute also??) by using
elems[0].tagName
and
elems[0].id
I get confused as they both return 'undefined', so what is it?
My example markup as follows
I want to collect all the child elements inside this two fieldset elements through looping.