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 11
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 dele
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 wrote:
> Hi,
>
> I got a problem using the following
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 wrote:
> Hi,
>
> I got a problem using the following code:
>
> $j = jQuery.noConflict();
> $j(document).ready(function(){
>
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
if(error.length
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 backgroun
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] get
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 wrote:
> I am creating a simple jQuery widget and have the following two lines
> in the _init() method.
>
> this.element.find("li.thumb img").
you can select multiple objects in the selector, like: $
("#obj1,#obj2,#obj3").change(...)
On Sep 15, 7:42 am, cgp wrote:
> I have 2 or more objects that onclick(), will call the same function.
> Right now I have the following:
>
>
> $("#obj1").change( function() {
> setupPage();})
utton.
>
> Am I misunderstanding?
>
> Rick
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of Mr Speaker
> Sent: Sunday, September 13, 2009 10:07 PM
> To: jQuery (English)
> Subject: [jQuery] Re: event coordinati
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 am,
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 wrote:
> I am missing something fundamental and am sure that someone can p
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 i
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 wrote:
> It's like tabbing to the next field is NOT the default action
,
but as its type is FBML - 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 wrote:
> On Sep 10, 9:49 am, Mr Speaker wrote:
>
> > I think it's perfectly valid to have a div inside a script tag (or
docs for blus() say "the default action 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 Spea
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 ca
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 not
Just use put a mouseover event on the trigger which shows the menu,
and a mouseout event on the menu itself... like
Start
All Programs
Recent Documents
Upgrade to a Mac
$('#startButton').mouseover(function(){
$('#startMenu').show();
});
$('#startMenu').mouseout(function(){
$(this).hi
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) {
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/
I
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 ev
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 wrote:
> All -
>
> I have a set of tabs that I have gotten to rotate through via this
> scipt:
>
> $(document).ready(function(){
> $("#tabs")
23 matches
Mail list logo