[jQuery] live() or click

2009-08-12 Thread pete
hi on document load i have to attach the click event to certain elements. performance wise whats better to use? LIVE() $("#container ul li").live('click', function(e) {} EVENT DELEGATION $('#container ul li').click(function(e) { if ($(e.target).is('li')) {...} }); thanks pete

[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: Cross server check if a pdf file exists

2009-04-22 Thread Pete
it's a regular url (www.somesite.com/somepdf.pdf) and it seems to be adding that '?jsonp_callback=?' with the code i have above. I'm trying to do it without server-side script. Has anyone tried this? On Apr 22, 4:49 pm, James wrote: > Oh, and to answer your question, I think when your results

[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] Objected Expected $ Conflict?

2008-12-22 Thread Pete
I'm trying to build a simple news carousel, click a tab and the corresponding div shows. My Code works in FF, Chrome, Opera and Safari but no luck in IE 6 or 7. I think it has something to do with $, because IE7 is saying there is an Object Expected at that char position. Any help is appreciated,

[jQuery] jQuery and VS.NET

2008-12-03 Thread Pete
or a quick guide on how to get started with jQuery and .NET but I have so far had no luck. Can anyone recommend a good place to start? Will jQuery become more integrated in VS.NET as a inbuilt library with debugging and predictive functuion names or something like that? Thanks Pete

[jQuery] Re: Underline stroke/height with Jquery css?

2008-11-19 Thread Pete
am, Liam Potter <[EMAIL PROTECTED]> wrote: > no. > > Whats wrong with using the border-bottom? > > Pete wrote: > > I'm looking for a way to adjust the height of an underline element. > > Specifically I'm not looking to do a border-bottom CSS attribute and

[jQuery] Underline stroke/height with Jquery css?

2008-11-19 Thread Pete
I'm looking for a way to adjust the height of an underline element. Specifically I'm not looking to do a border-bottom CSS attribute and I was wondering if there is some method in JQuery that could style a CSS element that cannot accept values. For example I could do the following: h1 {font:bol

[jQuery] Re: Jquery rounded corners

2008-11-14 Thread Pete
Unfortunately with that script (I think Methvin's?) it only takes the background color from the parent element when making the corners. The other solution out there (curvy corners) is extremely slow. I haven't personally found an ideal solution where the background needs to be an image or gradie

[jQuery] Re: Finding an input's label

2008-11-10 Thread Pete
Thanks, MorningZ. Tidied up your quote nesting and it worked a treat. Bit of a braindead moment for me... I sometimes forget how painfully simple and elegant jQuery is. :)

[jQuery] Finding an input's label

2008-11-10 Thread Pete
What's the easiest way to find an input's label? I'm trying to evaluate this along the lines of the following, but this doesn't work: $('label[for=this.attr("id")]').attr('class', 'error'); Any help appreciated.

[jQuery] Re: Can't use selectors in reference to a named object?

2008-11-10 Thread Pete
:input', thisForm).length + ']'); }); On Nov 10, 1:13 pm, "赵兵" <[EMAIL PROTECTED]> wrote: > try this:var f=$("form"); > $("input,textarea",f).each(function(){ > console.log($(this).attr("name")+'--'+$(this).val())

[jQuery] Can't use selectors in reference to a named object?

2008-11-10 Thread Pete
The following doesn't work as expected and I don't understand why--can someone explain, please? $('form').each( function() { var thisForm = $(this); alert(thisForm.attr('id') + ' [' + $('thisForm > :input.required').length + '/' + $('thisForm > *').length + ']'); )}; That I'm exp

[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: Setting the selected item in a combo box

2008-10-01 Thread Pete
7;#emplist',{selectValue: empSelected}); The getEmpListURL is the JSON string and the empSelected is the value passed to set the selected option to. Again, thanks Ricardo. I learned enough to take care of the problem and learned some more about jQuery On Oct 1, 6:46 am, Pete <[EMAIL PROTECTED]&g

[jQuery] Re: Setting the selected item in a combo box

2008-10-01 Thread Pete
ation of that code. Perhaps it can be modified to so handle a passed "selected value" so that the value shows selected when the combo is rendered. It may do that already. Thanks again. I learned quite a bit! Pete On Sep 30, 11:07 pm, ricardobeat <[EMAIL PROTECTED]> wrote: >

[jQuery] Re: Setting the selected item in a combo box

2008-09-30 Thread Pete
<[EMAIL PROTECTED]> wrote: > $('select').val('value') should work (it needs to be applied to the > , not the > > - ricardo > > On Sep 29, 6:55 pm, Pete <[EMAIL PROTECTED]> wrote: > > > I have an element that I populate with an Ajax call a

[jQuery] Setting the selected item in a combo box

2008-09-29 Thread Pete
idn't get it to work. It should be simple. But I can't seem to crack it. Suggestions? Thanks, Pete

[jQuery] Re: Unable to get the number of items in a combobox

2008-09-29 Thread Pete
> elements in your document. $("#id") doesn't return a single DOM > element, it returns a jQuery collection, with one DOM element in it. > > What WOULD work is: $("#emplist").get(0).length. ".get(0)" returns the > first (0th) DOM element which, since the

[jQuery] Unable to get the number of items in a combobox

2008-09-25 Thread Pete
quot; object has the correct value, how do I reference that in my jquery ? Somehow $('#emplist').length is wrong but I can't seem to figure out how to reference the correct value that is listed under "0" in firebug. Any ideas? What am I doing wrong in getting the number of items in the combobox? Thanks, Pete

[jQuery] File Exists

2008-09-09 Thread Pete
{ return confirm("Overwrite"); } else { return true; } }); } Any help is appreciated, Pete

[jQuery] Re: Looking for always vertically centered select box....

2008-07-21 Thread Pete
Ok. Point taken. I didn't want to mess around with divs if a select box could be manipulated beyond styling. Why recreate the wheel when select boxes work just fine for some tasks? On Jul 21, 2:24 pm, jquertil <[EMAIL PROTECTED]> wrote: > can't use a select box (i.e html SELECT tag) because th

[jQuery] Looking for always vertically centered select box....

2008-07-21 Thread Pete
I'm not sure how to describe this any better than the headline. I'm at the last stage of a project so if this is available as a plugin it would save me the time to create it. Essentially, when clicking a select box with numerical or time values, instead of the available choices dropping down or

[jQuery] getBoxObjectFor() is deprecated

2008-07-15 Thread Pete
o with the jquery flash plugin I'm using, but I can't find an answer for it. Anyone have any ideas? Thanks, -pete

[jQuery] Re: Using jQuery on imported content

2008-07-14 Thread Pete
hat I $ > > ('#mydiv").load('mypage.html') into. > > > > The problem I'm having is, I have anchors on "mypage" that I would > > like to effect with the click event on the "index" page. Trying to > > access these loaded anchors via $('a#anchorid').click(...), isn't > > working. Can someone show me how to handle this? > > > > Thanks! > > -pete >

[jQuery] Re: Selecting and cloning part of table structure

2008-04-03 Thread Pete Kruckenberg
Thanks, that's perfect. On Apr 3, 9:10 am, Qutoz <[EMAIL PROTECTED]> wrote: > Hi Pete, > I made an example, please review it and tell me if it doesn't match > your needs: > > > > > > > $(document).ready(function() { >  var newtable = $("#

[jQuery] Selecting and cloning part of table structure

2008-04-03 Thread Pete Kruckenberg
[Sorry if this is a dup, first one didn't seem to post.] Assuming I have 1 2 is there a way with jQuery to select and then clone the following (i.e. the table structure, but with just the first 1 Thanks for your help Pete.

[jQuery] Selecting part of table structure

2008-04-03 Thread Pete Kruckenberg
Assuming I have 1 2 is there a way with jQuery to select (and then clone) the following (i.e. the table structure, but with just the first 1 Thanks for your help. Pete.

[jQuery] Re: Chm version of the jQuery api browser

2008-03-31 Thread Pete Lees
don't think it can do such thing :-D. Have a look at the following article for a fairly simple way to alert users when a new version of the .chm file is available. http://www.writersua.com/mixingonlinechm.htm Pete

[jQuery] Re: Post to Preloaded AJAX Page?

2008-02-01 Thread Pete
meters? On Feb 1, 12:45 pm, andrea varnier <[EMAIL PROTECTED]> wrote: > On Feb 1, 8:28 pm, Pete <[EMAIL PROTECTED]> wrote: > > > $('a.module').click( function() { > > $.post('somepage.asp', { > > module: 'AP' >

[jQuery] Post to Preloaded AJAX Page?

2008-02-01 Thread Pete
I would like to post data to a page that is loaded into the DOM and refresh it, but I'm not sure how to do it. Lets say I'm starting on on default.asp. So when I click on a.openContact it properly loads "somepage.asp" into #contactSection --- $('a.openContact').click( func

[jQuery] Re: Scrollable image in a div

2008-01-25 Thread pete higgins
nt. (sorry in advance for loading jquery, dojo, and prototype on the same page) Regards, Peter Higgins On Jan 25, 2008 5:05 AM, Dave Stewart <[EMAIL PROTECTED]> wrote: > > Pete, > Great little plugin there! I've done teh same using vanilla > JavaScript; have yet to c

[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

[jQuery] WAI-ARIA support in jQuery?

2007-11-19 Thread Pete
Hi! Is anyone working on implementing the appropriate WAI-ARIA roles, states and properties [1] where relevant in jQuery? [1]: http://www.w3.org/TR/aria-roadmap/ Regards, Peter Krantz

[jQuery] (Mis)Behaviour of not() ?

2007-10-31 Thread Pete Kruckenberg
y). I'd expect it to be the inverse of "$ ('form :input').filter(':hidden[name=a])')" (which returns "[]". Am I misunderstanding the docs, or is this a bug with not()? I get the same results in both 1.2.1 and 1.1.4. Tested on FF2.0.0.8/ Win. Thanks. Pete.

[jQuery] Re: jQuery for Floating Div

2007-09-25 Thread Pete Bekisz
; Try here http://msdn2.microsoft.com/en-us/default.aspx > They optimize for IE7 of course. Top right link. > > Glen > > On 9/24/07, Pete Bekisz <[EMAIL PROTECTED]> wrote: > > > > Glen -- > > > > That's really slick! I don't think I'll be

[jQuery] Re: jQuery for Floating Div

2007-09-25 Thread Pete Bekisz
.commadot.com/jquery/slideMenu.php (click links at top) > > Pete, even though its not what you asked for, it might be a good choice. > > Glen > > On 9/24/07, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > > > Hey Glen, > > > > That's act

[jQuery] Re: jQuery for Floating Div

2007-09-25 Thread Pete Bekisz
bbed a CSS menu off of dynamicdrive.com -- if you rollover "tools," you'll see the div. However, when you move your cursor to the div, the hover color goes away. Any idea how to fix this? (New sample URL: http://www.keuka.edu/pete/popover) Also, abs positioning is giving me a hard t

[jQuery] jQuery for Floating Div

2007-09-24 Thread Pete
$(this).hide(); return false; }); }); The problem is, as soon as you move your mouse off the link to go into the div, it collapses. Could someone please offer some examples/ insight? If you'd like to see the page, here's a link: http://www.keuka.edu/pete/jquery_float.html Thanks!

[jQuery] AJAX GET error if file does not exist?

2007-09-14 Thread Pete
I'm creating a client side application using JQuery. It's wildly inefficient but unfortunately it's the cards I've been dealt on this one. I'm looking to get a page using either $AJAX or $GET. I'm able to get pages just fine if the file exists. If the file does not exist I get a permission den

[jQuery] AJAX GET from an higher directory. FF Yes IE No

2007-09-11 Thread Pete
I'm wondering if this is even possible. Essentially I'm looking to see if a file in an higher directory exists: $(this).find('a').click(function(){ $.get("../ajaxtest-content.html", function(data){ alert("I am here and I exist");

[jQuery] AJAX GET from an higher directory. FF Yes IE No

2007-09-11 Thread Pete
I don't even know if this is possible but I'm looking to get a page in an upper directory via an AJAX call. The following works in FireFox, but Internet Explorer throws a "Permission Denied". $(this).find('a').click(function(){ $.get("../ajaxtest-content

[jQuery] Re: OT: No form submit without JavaScript?

2007-09-07 Thread Pete
Ok. That makes perfect sense. Thank you. On Sep 7, 3:35 am, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Pete wrote: > > I have some forms that I perform validation on using the Validation > > plugin for jQuery. My sole purpose for this, is that I'd like to > >

[jQuery] OT: No form submit without JavaScript?

2007-09-07 Thread Pete
I have some forms that I perform validation on using the Validation plugin for jQuery. My sole purpose for this, is that I'd like to reduce spam (and my company gets quite a bit). I understand the tag, but is there a way to prevent form submission if a user does not have Javascript? I know ale

[jQuery] Re: Ajax call within ajax called page: IE error?

2007-08-13 Thread Pete
kbox.js", function(){ alert("Script loaded and executed."); }); }); }); Apparently Jquery does not have to be loaded Don't ask me why but it doesn't. Hope this helps anyone w

[jQuery] Ajax call within ajax called page: IE error?

2007-08-11 Thread Pete
I'm running into a problem with a simple Ajax call within an ajax called page in IE. I did a forum search and it didn't really clue me into what's going on. In the page: http://www.cyma.com/NEWCYMA/support/updatecenter/(Page 1) Clicking on "Version 9" loads a page with two god ugly tabs: "

[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete
.saveConfig").click(function() { >if ($('div.detail').is(':visible')) alert('Hey this works'); > > }); > > dennis. > > Pete wrote: > > I'm trying to create a link that when clicked will produce an alert if > > there ar

[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete
ck(function() { > >if ($('div.detail').is(':visible')) alert('Hey this works'); > > }); > > > dennis. > > > Pete wrote: > > > I'm trying to create a link that when clicked will produce an alert if > > > there are any visible div

[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete
s, .is() returns true or false so you have to use it in > > an if statement: > > > $("a.saveConfig").click(function() { > >if ($('div.detail').is(':visible')) alert('Hey this works'); > > }); > > > dennis. > > > Pete wrote: >

[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread Pete
I guess I'm still not getting "else" out of this. I thought I had it figured out I think what's confusing to me as a n00b is that "if" does not seem to be closed. How would I accomplish an else condition? On Aug 3, 11:27 am, Klaus Hartl <[EMAIL PROTECTED]>

[jQuery] IS condition true like an if statement?

2007-08-03 Thread Pete
I'm trying to create a link that when clicked will produce an alert if there are any visible divs (all .detail divs are hidden by default). I have the following function but it doesn't seem I'm doing it correctly; nothing happens regardless of the visibility status of the divs. $("a.saveConfig").

[jQuery] Google Maps like interface with JQuery

2007-07-09 Thread Pete
hin JQuery that would be a good starting point for this type of project? Cheers, Pete

[jQuery] Slide-in/out: Toggle right panel example?

2007-06-21 Thread Pete
would actually like to see how it's implemented. Any help? THX Pete