[jQuery] Re: jQuery.event.trigger()

2009-04-09 Thread Paul Thiel

Hey Ariel.

I am traveling much of the day today, so will throw something together
on the plane.

Cheers; P.

On Apr 8, 4:29 pm, Ariel Flesler afles...@gmail.com wrote:
 (Reply to either)

 Can you make a demo out of this ?
 Please put the unminified version of jQuery 1.3.2.

 --
 Ariel Flesler

 On Apr 8, 4:52 pm, Paul Thiel pjth...@gmail.com wrote:

  Hi guys.

  Trying again as not sure what happened to the previous post.

  I am using jQuery 1.3.2 and getting some unexpected behavior this
  morning.

  This works, with the alert being executed when the showpalette event
  is triggered.

  $().bind('showpalette', function() {
    alert('showing palette!');

  });

  $.event.trigger('showpalette');

  However, this does NOT work:

  $().bind('show.palette', function() {
    alert('showing palette!');

  });

  $.event.trigger('show.palette');

  Also, trying to trigger the event with an event object, thus:

  $.event.trigger({
     type : 'showpalette',
     palette : palette

  });

  ... also does not work with the bound handler seeing 'undefined' as
  the second parm (after the event object).

  If I trigger the event like this:

  $.event.trigger('showpalette', [palette]);

  ... it is getting though to the handler just fine.

  What am I missing?  Namespacing your events should be just fine in
  this scenario, right?

  Is there something about $.event.trigger() that is different to $
  ('#elem').trigger()??


[jQuery] Triggering a namespaced event

2009-04-08 Thread Paul Thiel

Hi guys.

Using jQuery 1.3.2 and getting some unexpected behavior this morning.

This works, with the alert being executed when the showpalette event
is triggered.

$().bind('showpalette', function() {
   alert('showing palette!');
});

$.event.trigger('showpalette');

However, this does NOT work:

$().bind('show.palette', function() {
   alert('showing palette!');
});

$.event.trigger('show.palette');


What am I missing?  Namespacing your events should be just fine in
this scenario, right?


[jQuery] jQuery.event.trigger()

2009-04-08 Thread Paul Thiel

Hi guys.

Trying again as not sure what happened to the previous post.

I am using jQuery 1.3.2 and getting some unexpected behavior this
morning.

This works, with the alert being executed when the showpalette event
is triggered.

$().bind('showpalette', function() {
  alert('showing palette!');
});

$.event.trigger('showpalette');

However, this does NOT work:

$().bind('show.palette', function() {
  alert('showing palette!');
});

$.event.trigger('show.palette');


Also, trying to trigger the event with an event object, thus:

$.event.trigger({
   type : 'showpalette',
   palette : palette
});

... also does not work with the bound handler seeing 'undefined' as
the second parm (after the event object).

If I trigger the event like this:

$.event.trigger('showpalette', [palette]);

... it is getting though to the handler just fine.


What am I missing?  Namespacing your events should be just fine in
this scenario, right?

Is there something about $.event.trigger() that is different to $
('#elem').trigger()??


[jQuery] Re: Triggering a click

2008-09-05 Thread Paul Thiel

At a glance it looks as though you are targeting the wrong element.
The parent() takes you to the DIV and the next() takes you to the next
DIV (awardnomination).  Just use $(this).prev('img').trigger('click')
or similar.

On Sep 5, 9:06 am, jerpod [EMAIL PROTECTED] wrote:
 I've got some html that looks like this:

 div class=awardheading
   img class=plusminus src=/images/plus.gif Some text here. a
 class=nominatelink href=#Make your nomination./a/div

 div class=awardnomination
         This is award info
 /div

 A click on the plusminus image shows/hides the awardnomination div.
 That's working.  I also want a click on the nominatelink to trigger a
 click on the image...since I've already got that working.

 I thought something like:

 $(this).parent().next('img').trigger('click')

 would work but I get nothing when clicking the link.  Thanks in
 advance!

 jp