[jQuery] Re: jQuery Ajax SUCCESS: using 'THIS'?

2009-05-01 Thread pete higgins
> > You need to copy the reference to your link to a variable like this: > > jQuery('#yt1').click(function(){ >  $(this).replaceWith("Approving..."); >  var aObj = $(this); if you are going to suggest this, go ahead and teach a good practice of not creating a new jq object unnecessarily: .click(

[jQuery] Re: jQuery Ajax SUCCESS: using 'THIS'?

2009-05-01 Thread pete higgins
hitch could do this. http://higginsforpresident.net/js/jq.hitch.js http://higginsforpresident.net/js/jq.hitch.min.js ... 'success': jQuery.hitch(this, function(msg){ alert($(this).attr('id')); }), ... Regards On Fri, May 1, 2009 at 12:48 PM, phpdevmd wrote: > > Hello, I have the following

[jQuery] Re: Animate Variable Concatenate Help

2009-04-30 Thread pete higgins
$(this).animate({ width: mywidth + "px" }); think: var newwidth = { "width": mywidth + "px" } Regards On Thu, Apr 30, 2009 at 5:54 PM, paper_robots wrote: > > I'm trying to get the width of an element, animate it bigger, then > shrink it back to normal size on hover. Here's my function: >

[jQuery] Re: Adding scope support to .bind()

2009-04-10 Thread pete higgins
ge"); this._input.bind('change', cb).ubind('change', cb); Again, pardon my ignorance of the bind/unbind pattern. Regards, Peter On Fri, Apr 10, 2009 at 5:52 AM, Azat Razetdinov wrote: > >> this._input.bind('change', $.hitch(this, "_onInputChan

[jQuery] Re: Adding scope support to .bind()

2009-04-08 Thread pete higgins
My hitch() method does this kind of: http://higginsforpresident.net/js/jq.hitch.js It would look like: this._input.bind('change', $.hitch(this, "_onInputChange")); Regards, Peter Higgins On Wed, Apr 8, 2009 at 12:03 PM, gregory wrote: > > the only difficulty I am having with > Balazs Endresz

[jQuery] Re: A simple jQuery script that throws errors and fails in IE6-7. Thoughts?

2009-03-09 Thread pete higgins
>            .css({ >                'display': 'block', >                'text-align': 'right', >            }) stray comma, after 'right' http://jslint.com Regards, Peter

[jQuery] Re: Objects Methods as event handlers.

2009-03-03 Thread pete higgins
Yet another opportunity to mention my hitch plugin (which is .bind in prototype) http://higginsforpresident.net/js/jq.hitch.js http://higginsforpresident.net/js/jq.hitch.min.js Regards, Peter On Tue, Mar 3, 2009 at 8:51 PM, Karl Rudd wrote: > > First a solution for you. Try this plugin: > >

[jQuery] Re: Custom Callback not using jQuery object

2009-02-25 Thread pete higgins
I never miss an opportunity to mention my uberuseful tiny [and only] jQuery plugin. "hitch" http://higginsforpresident.net/js/jq.hitch.js http://higginsforpresident.net/js/jq.hitch.min.js Regards, Peter On Wed, Feb 25, 2009 at 4:58 PM, Nic Hubbard wrote: > > Thank you.  I appreciate the explan

[jQuery] Re: What can we use in place of $.browser?

2009-02-25 Thread pete higgins
You would need to find whatever quirk it is you are targeting and create a function or otherwise create a scenario where that quirk is exposed, and use that to populate some identifier. eg: jQuery detects support.opacity by creating a and then later testing the opacity value or lack thereof. I

[jQuery] Re: jQuery / FF3 problem using "show()"

2009-02-10 Thread pete higgins
moving the above the

[jQuery] Re: How to save "this" context in callbacks

2009-02-07 Thread pete higgins
I still like the rescope function. :) http://groups.google.com/group/jquery-en/browse_thread/thread/43644231b5764f12?q=rescope+jquery#ca1b1069580a3f25 On Sat, Feb 7, 2009 at 8:03 PM, Karl Rudd wrote: > > Assign "this" to a local variable. > > function blah() { > var blahThis = this; > someEx

[jQuery] Re: teaching jquery instead of javascript ?

2009-01-08 Thread pete higgins
I'm inclined to agree. Having a good foundation of JavaScript before adopting any library will do these students a much greater service than simply teaching them an API that is already relatively easy to learn. Teach them JS, and in places where is really matters, show them how JQ (or the other li

[jQuery] Re: parallel inclusion dojo-storage+jquery

2009-01-06 Thread pete higgins
There are none. Dojo only takes a few globals for the namespace, and doesn't use $ for anything. There is no bad influence, other than the duplication in functionality between base dojo.js and jquery.js On Tue, Jan 6, 2009 at 10:27 AM, aldana wrote: > > hi, > > we are using jquery but we need fu

[jQuery] Re: setInterval(obj.method,200) problem: scoping?

2009-01-02 Thread pete higgins
Because I'm an advocate for licensing and was told I probably should mention: the 'rescope' function is a stripped down version of Dojo's dojo.hitch function. Infinitely useful in the real world, but technically if used [in production] should retain attribution. It is available under new BSD and

[jQuery] Re: setInterval(obj.method,200) problem: scoping?

2009-01-02 Thread pete higgins
Here is your orig snippet rewritten to use the rescope function I pasted: var datascape = { 'mouseX': 0, 'myInterval': 0, 'create': function(){ $('#datascape').bind('mousemove', rescope(this, function(e) { this.mouseX = e.pageX; })).bind("mouseover", rescope(t

[jQuery] Re: setInterval(obj.method,200) problem: scoping?

2009-01-02 Thread pete higgins
I've always found this bit of code useful: var rescope = function(scope, method){ if(!method){ method = scope; scope = null; } if(typeof method == "string"){ scope = scope || window; if(!scope[method]){ throw(['method not found']); }

[jQuery] Re: HELP: Screening questions for JavaScript developer candidates:

2008-12-31 Thread pete higgins
t; a = { toString:null }; > b = {}; > b[a] = 'test'; // TypeError: can't convert a to string > > All this is quite different from, say, Ruby, where any object *can* be used > as a hash key: > > irb(main):001:0> a = { 'a' => 'b',

[jQuery] Re: HELP: Screening questions for JavaScript developer candidates:

2008-12-31 Thread pete higgins
> and, yeah, I usually put in bare keys (sans quotes) unless necessary, too. > Not sure why. I guess I just like the clean look. Yah, they just seem to be wasted bytes, huh? One thing to note, and the only reason I try to force myself to use the quotes is for portability. If the data is "really"

[jQuery] Re: HELP: Screening questions for JavaScript developer candidates:

2008-12-31 Thread pete higgins
t;, "this-is":"valid also" } of course, we should mention accessing them too: foo["1bar"], foo["this-is"] and foo._iam Regards, Peter Higgins On Wed, Dec 31, 2008 at 9:34 AM, Karl Swedberg wrote: > On Dec 31, 2008, at 7:51 AM, pete higgins wrote: > >

[jQuery] Re: HELP: Screening questions for JavaScript developer candidates:

2008-12-31 Thread pete higgins
>// YUI compressor won't compress if you have no quotes on keywords >float: function() { >alert("float"); >}, >int: function(){ >alert("int"); >} > } > > a.float(); > a.int(); int and float are reserved words as well. Technic

[jQuery] Re: How to create an infinite loop?

2008-10-27 Thread pete higgins
your onend callback is being executed immediately (with the ()'s). you likely want: $(...).animate({ props }, 2000, "linear", function(){ scroll_list(h); }); to pass an anonymous function that will execute later (2000ms). Regards Peter Higgins On Mon, Oct 27, 2008 at 6:01 AM, gattu_marr

[jQuery] Re: Scrollable image in a div

2008-01-25 Thread pete higgins
Not offhand. In theory, mouse down triggers the bind(mousemove) and mouse up unbind's it, so you should not be seeing that behavior. There is a small typo in the args/invert checking above, i randomly added after pasting my test page into the email. var invert = (args ? (args.invert || false) :

[jQuery] Re: Scrollable image in a div

2008-01-24 Thread pete higgins
here's a stab. use it the same as the link wrt the html/css, and then $("#mydiv").DragPane({}); or $("#mydiv").DragPane({ invert: true }); if the backwardness of it is annoying to you. leaving off the scrollbars would be a matter of styling the #myDiv node overflow:hidden jQuery.fn.DragPane = f

[jQuery] Re: Fading a background image

2007-12-05 Thread pete higgins
One way would be to put two block elements in a third that has position:relative and the children each have position:absolute; top:0; left:0; and the one with text has a higher zIndex. Fade out the "underlay", leaving the content? On Dec 4, 2007 5:25 PM, jonhobbs <[EMAIL PROTECTED]> wrote: > > H