$(this).parents('div.popup')
On Feb 28, 8:47 pm, riotbrrd k...@riotbrrd.com wrote:
I have a bunch of Divs with class .popup. Each div is different in
what it contains; some are simple, some are pretty complex, containing
tables, other divs, etc..
If I have a link, for example,Cancel, within
It should be .parents
$(this).parents('div.popup:first')
On Feb 28, 9:05 pm, Rick Faircloth r...@whitestonemedia.com wrote:
Assuming that the cancel link has an id of 'cancel':
How about:
$(document).ready(function() {
$('#cancel').click(function() {
-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of mkmanning
Sent: Sunday, March 01, 2009 12:18 AM
To: jQuery (English)
Subject: [jQuery] Re: How to find a parent
It should be .parents
$(this).parents('div.popup:first')
On Feb 28, 9:05 pm, Rick
And that's what happens when you type a long-winded response, it
becomes redundant by the time you hit send :)
On Feb 28, 10:03 pm, mkmanning michaell...@gmail.com wrote:
The statement it has a parent div.popup somewhere up the tree (no
idea how many levels) implies to me that div.popup may
I've never experienced this myself. We have jQuery loading from the
explicit Google URL (https://ajax.googleapis.com/ajax/libs/jquery/
1.2.6/jquery.min.js) as opposed to the loader (although we're using
that on other products) so far with no issues. We get 6 million+
pageviews/month.
My guess
It's possible. Here's a more traditional way:
$('a').each(function(i,link){
if(i10){$(link).addClass('first');}
else if (i9 i20){$(link).addClass('second');}
else if (i19i30){$(link).addClass('third');}
else if
am, mkmanning michaell...@gmail.com wrote:
It's possible. Here's a more traditional way:
$('a').each(function(i,link){
if(i10){$(link).addClass('first');}
else if (i9 i20){$(link).addClass('second');}
else if (i19i30){$(link).addClass('third
The effects functions apply a style of display:block to the table. Try
wrapping the table in a div and slide the div .
On Feb 26, 1:36 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
wrote:
Hello Guys,
Take a look at the following
example:http://www.coldbeans.co.uk/expanding_table.html
$('input:checkbox:not(#notwanted)')
On Feb 26, 2:39 am, heohni heidi.anselstet...@consultingteam.de
wrote:
Hi,
is there a way to do this:
$(input:checkbox - but not this one id = #notwanted - ).click
(function(){ .
Thanks a bunch!
For those methods to work, the html has to be part of the DOM first.
On Feb 26, 3:33 am, stephen stephen.cant...@gmail.com wrote:
Hello,
has anybody managed to prepend and append elements to a set of dom
elements previously created on the fly with the $(html) function?
I've tried with
Sorry for not being clearer; that's what comes from posting at 3 in
the morning :P
I was going on the post's title, attempting to use .after(). As
Ricardo says, append/appendTo, prepend/prependTo work on newly created
nodes, but after/insertAfter, and before/insertBefore require that the
nodes be
will evaluate to class 'first', 51 to 'second', 85 to 'first' again
and so on.
cheers,
- ricardo
On Feb 26, 6:29 am, mkmanning michaell...@gmail.com wrote:
And just as an exercise, here's the 'jQuery' way chained:
$('a').filter(':lt(10)').addClass('first').end().filter(':gt(9):lt
(10)').addClass
If you're going to work with jQuery then all you need to know
(assuming you know HTML and CSS, and have a general understanding of
JavaScript) is contained in the docs.
var list = document.createElement(li); uses a DOM method (not
jQuery). The variable 'list' is a DOM node, a way to add text to
, mkmanning michaell...@gmail.com wrote:
If you're going to work with jQuery then all you need to know
(assuming you know HTML and CSS, and have a general understanding of
JavaScript) is contained in the docs.
var list = document.createElement(li); uses a DOM method (not
jQuery). The variable
You could post to the server with ajax, or since you have all the data
server-side, just render the page with the themes array already
populated and call the build function
On Feb 25, 11:55 am, shapper mdmo...@gmail.com wrote:
Hi Michael,
It is working fine. Thank You Very Much.
Just one
.27lamps.com/Beta/List/List5.html
But I keep having errors.
What am I missing?
Sorry, but I am just starting with JQuery.
Thank You,
Miguel
On Feb 23, 9:23 pm, mkmanning michaell...@gmail.com wrote:
That's because you changed levels to an object, which you don't need
to. Just use
JQuery creators and Microsoft.
This is the reason why I am starting with JQuery but I am still
learning ... but until now it seams great.
Thanks,
Miguel
http://www.27lamps.com/Beta/List/List5.html
On Feb 24, 4:57 pm, mkmanning michaell...@gmail.com wrote:
Creating a complete html string
The click event is bubbling, try adding event.stopPropagation()
On Feb 24, 1:07 pm, Chris macmichae...@gmail.com wrote:
Hello so I am trying to create an image that once clicked will trigger
the file input field but I am getting an error Here is what I am
doing:
# Set the image in the div
= levels.slice(-1);
var friendly = first.join(', ');
if (last) { friendly += ' e ' + last; }
return friendly;
}
I am not completely sure that I am doing this right because I get the
error before.
Thank You,
Miguel
On Feb 20, 5:02 pm, mkmanning michaell...@gmail.com wrote
Wow, I just uploaded a simple plugin that does this:
http://plugins.jquery.com/project/getAttributes and then saw your
post.
On Feb 21, 9:07 am, RotinPain rotinpain@gmail.com wrote:
After searching the web with no answer, I really need some help about
attributes in jquery
Here's the
The form has to include enctype='multipart/form-data'
On Feb 19, 2:23 pm, Simon sib...@gmail.com wrote:
Hello,
I am desperately trying to implement the Multiple File Upload Plugin
into a script. However, I seem to be having no end of problems simply
getting it to pass the files through.
I
Sure, just write a recursive function to walk the DOM and filter text
nodes:
function traverseDOM(node) {
if (node.nodeType == 3 node.parentNode.nodeName!='SCRIPT') {
//do something to the text content here
}
if
then 1 level.
How can I do it?
Thank You,
Miguel
- The subject is working fine.
-
On Feb 20, 1:50 am, mkmanning michaell...@gmail.com wrote:
You could modify the subject variable being put into the array to make
it an object: subject = {}
then add the option's value and text
:04 am, mkmanning michaell...@gmail.com wrote:
You shouldn't have to refer to the same object in different ways, $
(input:[name='donation_type']) will work for both getting the value
and binding an event.
The @ before the attribute name was deprecated as of version 1.2
On Feb 18, 9:51
with the text in it.
http://www.27lamps.com/Beta/List/List3.html
Could you, please, help me out?
Thank You,
Miguel
On Feb 18, 5:33 pm, mkmanning michaell...@gmail.com wrote:
The problem is with the version of jQuery you're using. Update to 1.3
(and don't include a space in the URI).
Try your
Short answer: yes no. I wrote something similar to mochaui in
mootools (check it out, it will give you a good idea of what you're in
for). You can create canvas tags using jQuery (e.g. var ctx = ($
('canvas').attr({'width':'500','height':'300'}).css
I suspect it's the dance you're having to do. Quickly testing in a
browser, If you use
xmlObjectTree = $(data)
then you can iterate through the animal tags.
Doing the dance in a browser yields an unrecognized expression syntax
exception. How did you come to use $($(data).text()); and what
You could also do this:
$('h2').after('div class=someclass/div').each(function(){
var _this = $(this);
_this.nextAll(':not(div.someclass)').each(function(){
var _that = $(this);
if(!_that.is('h2')){_that.appendTo(_this.next());}else{return
false;}
Get Firebug. Not meaning to sound flippant, but debugging with alerts
is painful and living in the past. Firebug will allow you to see
inside the object by doing console.log($tabs). To save you some
frustration, if you try and log a string plus the object to the
Firebug console you'll get [object
You can take a slightly different approach, which might simplify your
markup, css and js. Since you're using absolute positioning, you can
absolutely position your image over your text, then just toggle the
opacity on hover to reveal the text underneath. One advantage with
this approach is you're
the script after the body?
I am placing the script inside a js file and then I include it in
the head of the document.
Thanks,
Miguel
On Feb 18, 7:13 am, mkmanning michaell...@gmail.com wrote:
Here's a wholly different approach for consideration. Rather than try
and keep track of LI
If you must rely on the markup structure (and you're confident it
won't change), then you could use either suggestion (you might want to
check for speed), with some minor changes: anytime you find yourself
using a selector twice or more ( e.g. .parent().parent().parent() ),
then there's most
that to the file
and add the include.
Anyway, try to add a theme. The first is added but the second not.
Or better, I think it is added to the list but not to the page ...
Could you tell me what am I doing wrong?
Thanks,
Miguel
On Feb 18, 4:49 pm, mkmanning michaell...@gmail.com wrote
not change ...
... But the index input is on the Html code.
I just can't find the problem.
Thanks,
Miguel
On Feb 18, 5:21 pm, mkmanning michaell...@gmail.com wrote:
if you're using the ready function, remove the inner (function($)
{ ... })(jQuery); wrapper
On Feb 18, 9:13 am, shapper mdmo
The method that Josh posted is (in some people's opinion) the
preferred method for assigning values, and is sometimes called the
'default pattern' for obvious reasons (the other common form is the
guard pattern ). It, along with the ternary, is usually more
succinct than if/else, the latter being
try:
$(input:[...@id:chargetotal]).change(updateDonationTotal);
On Feb 18, 1:55 pm, gberz3 gbe...@gmail.com wrote:
Hi All,
I'm having a bit of a problem with selectors and binding in jQuery.
Basically I want to do 2 things:
1) create a javascript method callable by name that updates a div
of whether I'm looking
for its value or to bind to one of its methods. Can someone shed some
light on why I must call each of these methods on the input in the
different manners?
Thanks.
On Feb 18, 7:10 pm, mkmanning michaell...@gmail.com wrote:
try:
$(input:[...@id:chargetotal]).change
Here's a wholly different approach for consideration. Rather than try
and keep track of LI elements and regex their names with the current
index, just use an array placeholder and rebuild the list. Chances are
if the user is required to add items, the list isn't going to get
unmanageably huge (at
question, if I instead wanted to use multiple table cells
instead of one big colspan, is there a way to do this same sort of
thing without a div?
On Feb 12, 11:35 pm, mkmanning michaell...@gmail.com wrote:
That should read ..first-child of its parent,.. in the first
sentence
On Feb 12, 11:33
:last-child) would be it.
cheers,
- ricardo
On Feb 12, 4:19 am, mkmanning michaell...@gmail.com wrote:
Somehow the selector disappeared :P
$('input').nextAll(':last');
$(this).nextAll(':last');
On Feb 11, 10:17 pm, mkmanning michaell...@gmail.com wrote:
$(div :last-child); finds
In HTML checked is a boolean (of sorts), its presence is sufficient,
you don't need to set it to anything; if you want something unchecked
you should remove the 'checked' attribute. In XHTML, attribute
minimization is forbidden (i.e. attributes can't be empty), so the
proper syntax is
thanks for that, I didn't know and it seems to work perfectly
But why is it then when I do something like an alert($(mycheckbox).attr
('checked')); on an unckecked checkbox it returns false?
On Feb 12, 5:46 pm, mkmanning michaell...@gmail.com wrote:
In HTML checked is a boolean (of sorts
Hmm, the group went offline seconds after I posted; I swear it wasn't
my fault :P, so sorry if this appears twice;
Try this:
$(document).ready(function() {
$(tbody td).click(function(e) {
var index = $(this).parent().children().index(this);
alert(
Here's one way:
$(document).ready(function() {
$(tbody td).click(function(e) {
var index = $(this).parent().children().index(this);
alert( $(this).parents('tbody').prev().find('tr').children(':eq
('+index+')').text() );
});
$(tbody
Actually, Mark's use of 'first-child' is correct. ':first-child' is
used to indicate the the element is the first-child its parent, not
the parent element's first-child. The tr has a class of .ajax, and
since it's prepended to the tbody, it is the first-child of the tbody,
so the correct selector
That should read ..first-child of its parent,.. in the first
sentence
On Feb 12, 11:33 pm, mkmanning michaell...@gmail.com wrote:
Actually, Mark's use of 'first-child' is correct. ':first-child' is
used to indicate the the element is the first-child its parent, not
the parent element's first
Triggering the click on 'a' fires the click on the the 'td', which
triggers the click on 'a', which fires the click on 'td', etc. :)
On Feb 11, 9:40 am, johnallan jral...@hotmail.com wrote:
jquery 1.3.1
jq(#miniCalendarTable td).hover(
function(){ jq(this).addClass(hover) },
Inline JavaScript is generally frowned upon nowadays. A better
approach, if you can do it, is to separate your behavior from your
markup, the same as you separate your structure from your
presentation. It makes for cleaner, more accessible, and more
maintainable code. For the example above:
I just wrote this in response to this thread and haven't checked it
thoroughly (other than my head, which has been known to be buggy).
I prefer to be able to pass in a jQuery object as the parent:
jQuery.fn.childOf = function(a){
return (this.length === this.map(function(){if($.inArray
At the risk of repeating myself from other posts, You might save
yourself future problems if you use standards-based id/name attributes
(and if the framework you're using doesn't allow that, seriously
consider a different framework):
HTML 4 spec section 6.2 says, ID and NAME tokens must begin
Giving an inline element such as span a display of 'block' makes
it...display like a block element. Which means it will stretch to fit
its container (in this case the body), as all block elements do.
A few more thingsthat might help out:
If you want a block element to not do that, you can give
...@gmail.com wrote:
Are you talking about using Themes[0] in name?
The page was validated by W3C validator ...
Do you mean something else?
On Feb 11, 10:16 pm, mkmanning michaell...@gmail.com wrote:
At the risk of repeating myself from other posts, You might save
yourself future
$(div :last-child); finds all of the last-child elements, including
descendant elements (e.g. if there were an a inside the span in
your example it would be returned too). You can also not worry about
the parent at all and just use the sibling selector:
//or you could use :last-child
As
Somehow the selector disappeared :P
$('input').nextAll(':last');
$(this).nextAll(':last');
On Feb 11, 10:17 pm, mkmanning michaell...@gmail.com wrote:
$(div :last-child); finds all of the last-child elements, including
descendant elements (e.g. if there were an a inside the span in
your
rowIndex is a DOM property, so you'd have to use alert(trow
[0].rowIndex);
On Feb 10, 10:19 am, pantagruel rasmussen.br...@gmail.com wrote:
rowsBefore = row.rowIndex;
Ok, but jQuery(#activator + input).parent().parent(); selects the
row, but when I try to get rowIndex of that selected row
You might save yourself a world of pain if you use standards-based id
attributes:
HTML 4 spec section 6.2 says, ID and NAME tokens must begin with a
letter ([A-Za-z]) and may be followed by any number of letters, digits
([0-9]), hyphens (-), underscores (_), colons (:), and periods
(.).
XHTML
You could try this:
jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle', height: 'toggle'}, speed,
easing, callback);
};
On Feb 10, 12:31 pm, Paul Mills paul.f.mi...@gmail.com wrote:
Hi Chris,
It's a bit tricky trying to get 2 effects
For the second argument use $(form).serialize()
You should also use onsubmit=return CheckForm0(this);
although the best practice would be to remove the inline script and
bind
the submit event like this:
$('form').submit(function(){
//do your ajax here and return false
});
On Feb 10, 8:14 pm,
://nicolas.rudas.info/jQuery/getPlugin/may be
helpful
Otherwise I find Ricardo's suggestion the easiest. You could also do
some time tests to check whethercallingthese functions when not
really needed effects performance, and act accordingly
On Feb 9, 3:33 am, mkmanning michaell...@gmail.com wrote:
*Tab
the title or
any other text/element on the page. The choice boils down to how the
whole site/app is structured and development practices in use.
cheers,
- ricardo
On Feb 9, 3:29 pm, mkmanning michaell...@gmail.com wrote:
@Nicolas - I'm curious as to why you find Ricardo's easiest?
Ricardo's
Be aware that style.top is not necessarily the position of an element.
You can use $('TheDivInQuestion').position().top (and $
('TheDivInQuestion').position().left) to find it's actual position.
On Feb 9, 11:07 am, Michael Lawson mjlaw...@us.ibm.com wrote:
If you look at the documentation for
.
cheers,
- ricardo
On Feb 9, 5:25 pm, Stephan Veigl stephan.ve...@gmail.com wrote:
Hi Adrian,
as mkmanning already said, when you want to get the next / prev
element from the same selector, simply access the array.
In this case I prefer a for (var i=0; ips.length; i++) {...} loop
calls (2 on the first last)
Depending upon how many elements you may be operating on, the time
difference could become important.
On Feb 9, 1:51 pm, mkmanning michaell...@gmail.com wrote:
Silently for text(), but it returns null for html() (using Adrian's
second example/my example) so you'll
You can just check the length of the child li elements of ul#Themes:
$('#AddTheme').bind('click', function(){
// Other code
var len = $('#Themes li').length;
$theme = $('li class=Themes/li').appendTo
('#Themes');
$theme.append('input type=hidden
You could also just keep the list of functions in an array in your
external js file and then check the window object for them:
$(function() {
var funcs = [
'ManageCategoriesClick',
'HideByDefault',
'PrepareSplitForm',
'SetUpAdvertPopup',
'CheckAll',
*Tab+spacebar and it posts :P
You could put your list of functions in an array in your external js,
then call them on the window object in a loop:
$(function() {
var funcs = [
'ManageCategoriesClick',
'HideByDefault',
'PrepareSplitForm',
In your code you're attaching the hover event to the anchor tags; in
the sample html none of the anchors has a class (the class is on the
parent li element).
On Feb 8, 4:24 pm, MiD-AwE cr.midda...@gmail.com wrote:
Please help, I've been wrestling with this for too long now.
I've put together
FYI I just uploaded a plugin (http://plugins.jquery.com/project/
parseQuery) that's pretty small (449 bytes minified); it parses the
querystring into an object.
On Feb 5, 6:53 am, jQuery Lover ilovejqu...@gmail.com wrote:
Agree, that would be something useful... but it's better to have it as
a
301 - 368 of 368 matches
Mail list logo