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
>
> 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(
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
$(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:
>
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
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
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
> .css({
> 'display': 'block',
> 'text-align': 'right',
> })
stray comma, after 'right'
http://jslint.com
Regards,
Peter
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:
>
>
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
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
moving the above the
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
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
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
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
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
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']); }
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',
> 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"
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:
>
>
>// 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
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,
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
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
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
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
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. :)
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.
: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())
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
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
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
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:
>
<[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
idn't get it to work.
It should be simple. But I can't seem to crack it. Suggestions?
Thanks,
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
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
{
return confirm("Overwrite");
}
else
{
return true;
}
});
}
Any help is appreciated,
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
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
o with the jquery flash plugin I'm
using, but I can't find an answer for it. Anyone have any ideas?
Thanks,
-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
>
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 = $("#
[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.
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.
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
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'
>
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
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
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
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
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
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.
; 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
.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
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
$(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!
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
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");
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
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
> >
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
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
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:
"
.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
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
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:
>
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]>
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").
hin JQuery that
would be a good starting point for this type of project?
Cheers,
Pete
would actually like to see how it's
implemented.
Any help?
THX
Pete
72 matches
Mail list logo