What timing. Eduardo Lundgren and I have just been working on a plugin to do
this to help with jQuery UI testing:

http://ui.jquery.com/bugs/browser/trunk/ui/tests/jquery.simulate.js?rev=140

No Safari 2 support at this time (since UI supports only 3+), but Eduardo
said he'll add it at some point (right now we're focused on *using* the
plugin). Also, we're writing utility functions. So instead of

$("#foo")
  .simulate("mousedown", { clientX: 50, clientY: 50 })
  .simulate("mousemove", { clientX: 50, clientY: 50 })
  .simulate("mousemove", { clientX: 55, clientY: 55 })
  .simulate("mousemove", { clientX: 60, clientY: 60 })
  .simulate("mouseup", { clientX: 60, clientY: 60 });

you can simply call

$("#foo").simulate("drag", { dx: 10, dy: 10 });

- Richard

Richard D. Worth
http://rdworth.org/

On Wed, Jun 4, 2008 at 3:45 AM, KayakingJoe <[EMAIL PROTECTED]> wrote:

>
> Hi,
> var myButton = dojo.byId('mybutton');
> var evObjclick = document.createEvent('MouseEvents');
> evObjclick.initMouseEvent( 'click', true, true, null, 0, 27, 53,
> 27,53, false, false, false, false, 0, null );
> myButton.dispatchEvent(evObjclick);
>
> I'm looking for a cross-browser solution to the above vanilla js,
> which works in FF but not IE. Can you do this using jquery ?
> Thanks
>

Reply via email to