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
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
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:
$(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
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
, 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
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
.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 karl.r...@gmail.com wrote:
First a solution for you. Try
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
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
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
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 =
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
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']); }
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,
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
// 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
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
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
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
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
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
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
[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
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
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
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.
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. :)
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
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,
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
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
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
, 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
be simple. But I can't seem to crack it. Suggestions?
Thanks,
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
)
{
return confirm(Overwrite);
}
else
{
return true;
}
});
}
Any help is appreciated,
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
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
with the jquery flash plugin I'm
using, but I can't find an answer for it. Anyone have any ideas?
Thanks,
-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
/table
Thanks for your help.
Pete.
tbody
tr id=first
td1/td
/tr
/tbody
/table
Thanks for your help
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:
html
head
script src=jquery.js/script
script
$(document).ready(function() {
var newtable = $(#mytable).clone(true
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
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(
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
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
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 =
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
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
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.
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
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
.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
;
});
});
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
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(){
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);
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
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
.);
});
});
});
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
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:
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.
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
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
() {
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
() {
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
that
would be a good starting point for this type of project?
Cheers,
Pete
actually like to see how it's
implemented.
Any help?
THX
Pete
71 matches
Mail list logo