[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
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 phpde...@gmail.com wrote: Hello, I

[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(iApproving.../i);  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:

[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 mresto...@gmail.com 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

[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 james.gp@gmail.com wrote: Oh, and to answer your question, I

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

2009-04-10 Thread pete higgins
, pete higgins phigg...@gmail.com wrote: 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 gregory.tomlin

[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 gregory.tomlin...@gmail.com wrote: the only difficulty I am

[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 karl.r...@gmail.com wrote: First a solution for you. Try

[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 div style=opacity:0.5 and then later testing the opacity

[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 nnhubb...@gmail.com wrote: Thank you.  I

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

2009-02-10 Thread pete higgins
moving the link above the script will likely fix this. On Tue, Feb 10, 2009 at 12:21 PM, JohnnyCee jfcardi...@gmail.com wrote: I wrote a relatively simple jQuery script to pick a random item from a list and show it. The other items are hidden. The script works in FF2, IE7, and IE8 RC 2. It

[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 karl.r...@gmail.com wrote: Assign this to a local variable. function blah() { var blahThis =

[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 ald...@gmx.de wrote: hi, we are using jquery but

[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: 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,

[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: 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. Technically, you are

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

2008-12-31 Thread pete higgins
them too: foo[1bar], foo[this-is] and foo._iam Regards, Peter Higgins On Wed, Dec 31, 2008 at 9:34 AM, Karl Swedberg k...@englishrules.com wrote: On Dec 31, 2008, at 7:51 AM, pete higgins wrote: int and float are reserved words as well. Technically, you are supposed to quote all keys (JSON

[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
hash key. -Mike From: pete higgins About anything can be a key in JS. (DomNodes can't, though btw, but functions objects etc) var bar = { a:b, c:d }; var bar2 = [1,2,3,4]; var foo = {}; foo[bar] = baz; foo[bar2] = baz2; if(bar in foo){ console.log(foo[bar]); } // baz if(bar2 in foo

[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

[jQuery] jQuery and VS.NET

2008-12-03 Thread Pete
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] 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

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

2008-11-19 Thread Pete
[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 I was wondering if there is some method in JQuery that could style

[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

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

2008-11-10 Thread Pete
pm, 赵兵 [EMAIL PROTECTED] wrote: try this:var f=$(form); $(input,textarea,f).each(function(){ console.log($(this).attr(name)+'--'+$(this).val()); }); maybe this is what you want! On Mon, Nov 10, 2008 at 8:09 PM, Pete [EMAIL PROTECTED] wrote: The following doesn't work as expected and I

[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: 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] 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

[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,

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

2008-10-01 Thread Pete
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: 'select' is the selector (:D

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

2008-10-01 Thread Pete
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] wrote: Ricardo.  Thanks very much! I'll need to give this some thought then.  The timing is an issue (I

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

2008-09-30 Thread Pete
to be applied to the select, not the option - ricardo On Sep 29, 6:55 pm, Pete [EMAIL PROTECTED] wrote: I have an element that I populate with an Ajax call and returns a list of items for a combo box. In some cases the page containing the element gets loaded with existing values and rendered

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

2008-09-29 Thread Pete
, 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 there is only one element, will be your #emplist element. On Sep 25, 2:15 pm, Pete [EMAIL PROTECTED] wrote: I don't have a lot

[jQuery] Setting the selected item in a combo box

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

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

2008-09-25 Thread Pete
').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] 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] 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 that

[jQuery] getBoxObjectFor() is deprecated

2008-07-15 Thread Pete
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
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] Selecting part of table structure

2008-04-03 Thread Pete Kruckenberg
/table Thanks for your help. Pete.

[jQuery] Selecting and cloning part of table structure

2008-04-03 Thread Pete Kruckenberg
tbody tr id=first td1/td /tr /tbody /table Thanks for your help 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: html head script src=jquery.js/script script $(document).ready(function() {  var newtable = $(#mytable).clone(true

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

2008-03-31 Thread Pete Lees
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] 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(

[jQuery] Re: Post to Preloaded AJAX Page?

2008-02-01 Thread Pete
varnier [EMAIL PROTECTED] wrote: On Feb 1, 8:28 pm, Pete [EMAIL PROTECTED] wrote: $('a.module').click( function() { $.post('somepage.asp', { module: 'AP' }, function() { document.write(module)); }); return false; }); Hi :) you

[jQuery] Re: Scrollable image in a div

2008-01-25 Thread pete higgins
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 convert it to jQuery but this is a nice insight. One

[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 =

[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: HI

[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
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
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 time ... looks fine on FF, but not so great on IE. I'm assuming this is a CSS thing, though. On 9/24/07, Karl Swedberg

[jQuery] Re: jQuery for Floating Div

2007-09-25 Thread Pete Bekisz
in google. :) Yeah, that amazon effect is really useful. I tried to do that with Intuit, but couldn't figure it out, so I ended up with the slideLinks instead. These did very well in usability studies. Unexpected wow. http://www.commadot.com/jquery/slideMenu.php (click links at top) Pete, even

[jQuery] Re: jQuery for Floating Div

2007-09-25 Thread Pete Bekisz
.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 able to use it on this project though, but I think it's great for a quicklinks feature. It just pulled

[jQuery] jQuery for Floating Div

2007-09-24 Thread Pete
; }); }); 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

[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(){

[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] 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 reduce spam (and my company gets quite

[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 NOSCRIPT tag, but is there a way to prevent form submission if a user does not have Javascript? I

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

2007-08-13 Thread Pete
.); }); }); }); Apparently Jquery does not have to be loaded Don't ask me why but it doesn't. Hope this helps anyone who searches for this later on. On Aug 10, 3:35 pm, Pete [EMAIL PROTECTED] wrote: I'm running into a problem with a simple Ajax call within an ajax

[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] 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.

[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] wrote: Pete wrote: I'm trying to create

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

2007-08-03 Thread Pete
boolean. -GTG On 8/3/07, spinnach [EMAIL PROTECTED] wrote: try it like this, .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: I'm

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

2007-08-03 Thread Pete
() { 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 divs (all .detail divs are hidden by default). I have the following function but it doesn't seem I'm

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

2007-08-03 Thread Pete
() { 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 divs (all .detail divs are hidden by default). I have the following function but it doesn't seem I'm doing

[jQuery] Google Maps like interface with JQuery

2007-07-09 Thread Pete
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
actually like to see how it's implemented. Any help? THX Pete