The a.delete click handler only attaches to _current_ elements on
the page. If you want to bind to future elements (that you build
dynamically) you can use the .live method:
$(a.delete).live( click, function(){ alert( test ); } );
(Also, another solution is to take advantage of event delegation
BTW, just to be clear: there shouldn't EVER be a reason ever to do: $($
(el).parents('div').get(0)).addClass('blah')
You'd just be getting all the parent divs, asking for their actual DOM
references (for no reason) then re-wrapping them into jQuery objects
before adding classes to them!
On Nov
The event you get from jQuery handlers is normalised. CurrentTarget is
just this in the function.
mouseover(event){
alert(this.id);
}
On Sep 19, 7:00 am, Philipp philipp.ma...@googlemail.com wrote:
Hi,
I got a problem using the following code:
$j = jQuery.noConflict();
Woah, I just noticed (2 minutes after my reply) this post:
http://brandonaaron.net/blog/2009/05/12/jquery-edge-bind-with-a-different-this
That says in 1.3.3 that currentTarget will be normalised cross-browser
too.
On Sep 19, 7:00 am, Philipp philipp.ma...@googlemail.com wrote:
Hi,
I got a
you can select multiple objects in the selector, like: $
(#obj1,#obj2,#obj3).change(...)
On Sep 15, 7:42 am, cgp cgpala...@gmail.com wrote:
I have 2 or more objects that onclick(), will call the same function.
Right now I have the following:
$(#obj1).change( function() {
Is it just because alert() is not allowed in FF? (needs to be alert(1)
or some-such). The code looks fine to me otherwise.
On Sep 15, 5:38 am, ChrisP idevt...@gmail.com wrote:
I am creating a simple jQuery widget and have the following two lines
in the _init() method.
I think you need to set the context for the function to that of the
link using the JavaScript call function... like:
function DoSomething( ctx ){
alert( ctx.text );
}
var linky = $('a');
var onclick = $('a').attr('onclick');
onclick.call(linky[0]); // Alerts 'asd'
BTW: the linky[0]
Yep, jquery functions apply themselves to all the elements you
selected. You only need to use each command if you need to do your own
custom handling... Lik um,
$(li).each(function(idx){
$(this).css('background-color', '#' + idx + idx + idx);
});
Ok, bad example (this sets the background
I think the problem is that you only ever remove a node when there is
no errors. Why don't you just remove ALL error messages each call - so
you'll only ever be showing the most recent error:
function(error){
$('.error-message').remove(); //remove ALL previous error messages
[mailto:jquery...@googlegroups.com] On
Behalf Of Mr Speaker
Sent: Sunday, September 13, 2009 10:07 PM
To: jQuery (English)
Subject: [jQuery] Re: event coordination problem
I pasted your code into a new HTML doc and it ran as expected: if you
put the focus in the textbox (#id1) then click
I pasted your code into a new HTML doc and it ran as expected: if you
put the focus in the textbox (#id1) then click the button (#id2) both
events get fired (blur event fires first, click event fires second).
Is there anything else in your page? Are you getting any JS errors?
On Sep 13, 4:27
That website you linked to doesn't use Ajax, so it loads all the wines
in in one go. If there wasn't many items then this would be the best
way to go. Otherwise, you'll have to take the db hit: which wouldn't
be too bad if you've got it caching stuff properly...
But if you load them all at once
Your code is fine - I think it has to do with the float cascading to
the menu items. If you add in float:none to the children li elements
it should work:
#NavList li ul li {
...
float:none;
}
On Sep 11, 10:27 pm, GLSmyth george.sm...@gmail.com wrote:
I am missing something fundamental and am
Any extra options for the toggle can go where the opacity option is:
{ fx: { opacity: 'toggle', duration: 1000 } }
On Sep 10, 7:27 am, -e-train etrai...@gmail.com wrote:
All -
I have a set of tabs that I have gotten to rotate through via this
scipt:
$(document).ready(function(){
That code looks fine - so wordpress must be messing it up.
It looks like jQuery is loading fine, else it would never get to the $
('a') line. Perhaps you could try the LIVE event:
$(function() {
$('a').live( click, (function() {
$('#box').fadeOut();
});
});
Which would add the click
I think it's perfectly valid to have a div inside a script tag (or at
least useful), if a div makes sense to the TYPE you defined for the
script. For example, John Resig uses a script tag with type text/
html in his micro-templating solution:
http://ejohn.org/blog/javascript-micro-templating/
In
I thought that's what alsoResize was for... couldn't you do something
like:
$('#myDiv').resizable({alsoResize: '#myDiv img'});
or something like that? Otherwise, perhaps you could use the resizable
event, and do the resizing yourself:
$('#myDiv').resizable({
resize: function(event, ui) {
Just use put a mouseover event on the trigger which shows the menu,
and a mouseout event on the menu itself... like
a href=# id=startButtonStart/a
ul id=startMenu
liAll Programs/li
liRecent Documents/li
liUpgrade to a Mac/li
/ul
$('#startButton').mouseover(function(){
What's the problem? That code looks perfect... have you looked in
Firebug to see where it's adding/removing the class names?
On (unrelated) issue the code might have is the selector you use is
'#nav li a' which will select all of those second level nav elements
too: red/green/black - if that's
I think the problem is that according to the W3C standards, the blur
event is not cancelable: They don't seem to want the programmer to be
able to mess with a blur...
But also, your validation code is a bit buggy anyway: the ret
variable is undefined and the regex you use will only catch the
can be prevented
by returning false. Maybe it should be corrected.
Your suggestion of using setTimeout produces the desired results. Like
you said, not too pretty but effective.
Thanks!
On Sep 9, 7:40 pm, Mr Speaker mrspea...@gmail.com wrote:
I think the problem is that according
- I'm guessing they got stuck implementing
some dodgy Facebook app... ergh. So, best of luck to him/her!
On Sep 10, 1:59 pm, RobG robg...@gmail.com wrote:
On Sep 10, 9:49 am, Mr Speaker mrspea...@gmail.com wrote:
I think it's perfectly valid to have a div inside a script tag
I think they don't let you hold focus for a reason... I've tried it on
a couple of my forms and it's annoying! I wanna leave it blank and
come back to it damn it! ;)
On Sep 10, 2:27 pm, Mr Speaker mrspea...@gmail.com wrote:
It's like tabbing to the next field is NOT the default action
23 matches
Mail list logo