[jQuery] Re: Combine JQuery objects question

2009-07-27 Thread Kean
Why post the question if you had the answer? On Jul 27, 8:40 am, www.voguemalls.com yuyuhua...@gmail.com wrote: who knows if it is possible to join two jQuery objects to make a new object.  For example... var e1 = $(#firstObject); var e2 = $(#secondObject); var combined = e1.add(e2);  //

[jQuery] Re: remove question

2009-06-12 Thread Kean
W3C says that id should not start with a number Here's probably what you need. $('#1').remove(); On Jun 11, 7:44 pm, David .Wu chan1...@gmail.com wrote: Can I remove div1 but div2 keep there? div id=1 div id=2/div /div

[jQuery] Re: css() function returns different results on different browsers

2009-06-12 Thread Kean
It's not really a huge bug and please do submit this as an enhancement to jQuery tracker. On Jun 11, 12:57 pm, upsilon upsilo...@gmail.com wrote: Hi everyone! Today I've tried to create simple hover effect on a div: if the cursor is over the box, the background-image css property of the div

[jQuery] Re: binding and re-binding

2009-06-11 Thread Kean
Instead of doing $(selector).click(function(){}); $(selector).bind('click', function(){}); use $(selector).live('click', function(){}); On Jun 11, 12:04 pm, Sasha sasha.akh...@gmail.com wrote: Hi everyone.  I've run across what must be a common problem: When my page loads, I bind every

[jQuery] Re: click function on anchor element

2009-06-11 Thread Kean
Interesting! That's also the same with labeling object properties. The label will be casted into their string representation. a href=hi.html id=yaasdf/a $('#ya').click(function(){ a = {}; a[this] = 1; cache = this; }); alert(a[cache.toString()]); // alerts 1 On Jun 11, 12:16 pm,

[jQuery] Re: Get all unique class names

2009-06-11 Thread Kean
option value=1 class=a/option option value=1 class=b/option option value=1 class=c/option option value=1 class=d/option option value=1 class=e/option option value=1 class=f/option option value=1 class=a/option option value=1 class=g/option /body script language=javascript var allClassName =

[jQuery] Re: ownerDocument is null

2009-06-11 Thread Kean
this[0].ownerDocument It's used by some functions to create elements that can be appended, wrapped, inserted into your current element. Meaning the created elements must match the same document context as the current element. It can be troublesome when this[0] === document as

[jQuery] Re: How to flip the image?

2009-06-11 Thread Kean
Pretty easy to do with canvas and the JavaScript that came with it. However, you might have be aware of the compatibility issues surrounding it. On Jun 11, 1:16 pm, waseem sabjee waseemsab...@gmail.com wrote: I once came across a php class the worked exactly like jquery selectors. retrieveing

[jQuery] Re: calling functions between multiple document ready events

2009-05-29 Thread Kean
@Brian You might have solve the problem but I don't think polluting the jQuery namespace is a good thing. This will work too. $(function(){ myNamespace = {}; myNamespace.displayMessage = function(){ alert('testing') }; // works fine }); $(function(){ myNamespace.displayMessage();

[jQuery] Re: How to disable all clicks till the page loads

2009-05-13 Thread Kean
You can try these. $().bind('click.noclick', function(){ return false; }); $(function(){ $().unbind('click.noclick'); }); On May 12, 11:56 pm, bobin bobinthoma...@gmail.com wrote: Any one can please tell me  How to disable all clicks till the page loads Any help wil be appreciated

[jQuery] Re: jQuery too slow on IE!!!

2009-05-13 Thread Kean
If speed is paramount to your project and you still want some some abstraction/cross browser functionality, you can checkout some other libraries out there. Here's some comparison on how they perform. http://dante.dojotoolkit.org/taskspeed/ On May 12, 5:42 am, Chandan

[jQuery] Re: how to convert a string to json structure

2009-04-27 Thread Kean
http://www.json.org/ You can find information about the structure, JSON parsers in several languages etc. On Apr 27, 1:13 am, gaohk cnga...@gmail.com wrote: I have a string that is like [{carePacks: [{businessCode:J1PS,description:HP 1}],coveragePeriod:12},

[jQuery] Re: Where to find a jQuery Developer?

2009-04-27 Thread Kean
http://jobs.jsninja.com/ On Apr 27, 9:58 am, nmiddlew...@gmail.com nmiddlew...@googlemail.com wrote: I would rather because I'd also like to learn on the way... Are you thinking yourself? Where are you based? Thanks, Nick On Apr 27, 5:35 pm, Joseph Le Brech jlebr...@hotmail.com wrote:

[jQuery] Re: Creating custom attributes in html

2009-04-16 Thread Kean
I see a lot of string concatenations. Use this instead. var str=[]; for(var i=0; i200; i++) str.push('table id=a_'+ i + '/table'); $(str.join('')).appendTo('div'); Also, from a performance standpoint, it's much faster to use W3c DOM methods to create nodes than using the innerHTML method to

[jQuery] Re: Creating custom attributes in html

2009-04-16 Thread Kean
@Josh Powell - string concatenation is plenty fast 99% of the time and a lot more readable. Yes string concatenation is more readable and 99% faster for normal usage. But looping and concatenate a huge chunk in this particular case is slower. Reason: every + between 2 strings returns a new string

[jQuery] Re: Is it possible to override a link?

2009-02-23 Thread Kean
There are a couple of options, depending on your needs. $('a#woof').click(function(e){ e.preventDefault(); //do ajax form }); $('a#woof').click(function(e){ //do ajax form return false; // preventDefault and stopPropagation }); On Feb 23, 9:12 am, Frederik Ring frederik.r...@gmail.com

[jQuery] Re: A question for John Resig

2009-02-18 Thread Kean
Matt, While it would not affect the results, I believe you can shave a few ms off by using === On Feb 18, 11:26 am, Matt Kruse m...@thekrusefamily.com wrote: On Feb 18, 6:57 am, John Resig jere...@gmail.com wrote: typeof FOO === string typeof FOO === number typeof FOO === boolean ==

[jQuery] Re: insert div into group ordered by ID..

2009-02-18 Thread Kean
Just a suggestion, if you just need to sort the elements by id and displaying their order without modifying the DOM you can totally do this alert($('#group div').add('#delta').get().sort(function(a,b) {return a.id b.id;})); On Feb 18, 12:15 pm, Ricardo Tomasi ricardob...@gmail.com wrote:

[jQuery] Re: A question for John Resig

2009-02-18 Thread Kean
Seems like my hunch is incorrect, thanks for correcting. On Feb 18, 12:43 pm, Matt Kruse m...@thekrusefamily.com wrote: On Feb 18, 2:20 pm, Kean shenan...@gmail.com wrote: While it would not affect the results, I believe you can shave a few ms off by using  === Over 10,000,000 iterations

[jQuery] Re: Popup going under flash object

2009-01-22 Thread Kean
Problem might be with flash. add param wmode=transparent embed wmode=transparent On Jan 22, 7:36 am, ptmurphy ptmur...@bellsouth.net wrote: I have a web page I have been working on and everything looks good in IE.  However, in Firefox I am having a problem with the datepicker popup window

[jQuery] Re: Add Checkboxes in a table.

2009-01-22 Thread Kean
Let me guess, you wanted to add a new row and it is almost identical to the row before it. This will probably work. $row = $('table tr:last-child').clone(); $row.appendTo('table'); On Jan 22, 7:42 am, Andy adharb...@gmail.com wrote: I need to be able to dynamically add a new rows to a table

[jQuery] Re: how to do '++' in jQuery

2009-01-21 Thread Kean
Probably there's a better way. Doesn't look elegant. $('xx').width($('xx').width()++) ; On Jan 21, 2:05 am, David .Wu chan1...@gmail.com wrote: some times we want to do some animation we use xxx.width++ in jQuery we give value like this $('xx').width(value) how to do ++ thing in this way?

[jQuery] Re: Selector Help

2009-01-18 Thread Kean
This works and will take care of unchecked conditions too. $('table tr[id^=row] :checkbox').click(function(){ $$ = $(this); $text = $$.parent().parent().find('.email, .contact'); if($$.is(':checked')) { $text[0].value = 'Email Checked';

[jQuery] Re: Selector Help

2009-01-18 Thread Kean
Oops, $checkbox.val(''); should be $text.val(''); On Jan 18, 1:23 pm, Kean shenan...@gmail.com wrote: This works and will take care of unchecked conditions too. $('table tr[id^=row] :checkbox').click(function(){         $$ = $(this);         $text = $$.parent().parent().find('.email

[jQuery] Re: sorting a select list of option elements

2009-01-16 Thread Kean
Only true arrays will inherit the sort method. On Jan 16, 10:10 am, brian bally.z...@gmail.com wrote: Maybe use makeArray() first. Something like: $.makeArray($('#ops-memb option')).sort(... On Fri, Jan 16, 2009 at 11:04 AM, mtz tracey.zellm...@gmail.com wrote: I have a select list into

[jQuery] Re: Smooth page auto scrolling - how to they do this?

2009-01-15 Thread Kean
This is your solution http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12 On Jan 15, 4:36 pm, Nico nicope...@gmail.com wrote: I'm very impressed by this websitehttp://www.blackestate.co.nz/ Does anyone know a jquery plugin that would allow that smooth page auto scrolling

[jQuery] Re: jQuery website errors

2009-01-14 Thread Kean
Also http://docs.jquery.com/Frequently_Asked_Questions On Jan 14, 9:40 am, brian bally.z...@gmail.com wrote: FYI, this page currently is throwing a DBQueryError: http://docs.jquery.com/UI/Tabs

[jQuery] Re: What am I getting this error?

2009-01-13 Thread Kean
Escape your quotes or use a different quote Escape quote var tour-info-div = '$(\'this\').prev(\'.tour-info-div\')' ; var update-div = '$(\'this\').prev(\'.update-div\')' ; Use double quote var tour-info-div = $('this').prev('.tour-info-div'); var update-div =

[jQuery] Re: Code simplification?

2009-01-13 Thread Kean
Try this if you can't change your html (function($) { $.fn.replaceClass = function(class1, class2){ $(this).removeClass(class1).addClass(class2); } })(jQuery); $('.nav_company').hoverIntent(function() { // toggle display of company sub menu content panel $

[jQuery] Re: @name deprecated?

2009-01-13 Thread Kean
Yes On Jan 13, 1:10 pm, Micky Hulse rgmi...@gmail.com wrote: Does this: $('inp...@name=status]').attr($attr_options_01); Need to be this: $('input[name=status]').attr($attr_options_01); With the latest version of jQuery? I was reading somewhere on this group about this type of change?

[jQuery] Re: $(window).bind('resize', fn) not working in IE

2009-01-13 Thread Kean
try $(window).resize(fn); On Jan 13, 3:54 pm, sam sam.from.hackern...@gmail.com wrote: Can anyone verify that $(window).bind('resize', fn) doesn't work in IE?  $(window).bind('scroll', fn) works fine for me, but not resize. I'm using 1.2.6. Thanks.

[jQuery] Re: Can't figure out how to traverse the DOM to these values...

2009-01-13 Thread Kean
So far reading all your post today points to one thing in common. You don't really distinguish between types of objects (ie array, string, objects etc) https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference Go there and learn about objects first. Hope it helps. On Jan 13, 5:04 pm,

[jQuery] Re: createElement, get its value

2009-01-13 Thread Kean
Hmmm, you must understand event listener(bind) does not work like CSS where DOM nodes added in the future cannot be listened right now. That's where event delegation comes it. http://www.learningjquery.com/2008/03/working-with-events-part-1 On Jan 13, 4:58 pm, sam

[jQuery] Re: Capture a click outside of a specific object?

2009-01-13 Thread Kean
You might want to look at live and die method now posted in jQuery documentation. On Jan 13, 11:32 am, riotbrrd k...@riotbrrd.com wrote: Hi all, Is there a simple way to capture a click event in a window/document and then determine whether the click was inside an element #foo, or outside of

[jQuery] Re: createElement, get its value

2009-01-13 Thread Kean
using jQuery 1.3 This will most probably work. $('#grabMe').live('click', function() { alert($(this).html()); }); On Jan 13, 5:41 pm, Kean shenan...@gmail.com wrote: Hmmm, you must understand event listener(bind) does not work like CSS where DOM nodes added in the future cannot

[jQuery] Re: Old code not working with new 1.2.6

2009-01-12 Thread Kean
jQuery 1.3 is going to be released soon. You might want to try to see if it works with 1.3b2. Also, it might be helpful to publish snippets of html that relates to your query. On Jan 12, 11:27 am, bryce4president brycekmar...@gmail.com wrote: I had a piece of code that worked with 1.2.2 but

[jQuery] Re: Any trick to making text at has been faded in look good?

2009-01-12 Thread Kean
Learned something today.. it's nice to know that the filter attribute is causing the problem and to remove it when finished with the animation. On Jan 12, 10:09 am, Rick Faircloth r...@whitestonemedia.com wrote: Thanks for the reply, Mauricio, but I couldn't get your solution to work. Adding

[jQuery] Re: Problem with creating dynamic html...

2009-01-12 Thread Kean
in 1.3 it will be something like this $(),live('click', function(){ }); or you can do something like this in 1.2.6 $().click(function(e){ e = e.target || e.srcElement; if $(e).is('CSS selector') fire the function }); adding some bubbling $().click(function(e){ e =e.target ||

[jQuery] Re: Any trick to making text at has been faded in look good?

2009-01-12 Thread Kean
', '') ??? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Kean Sent: Monday, January 12, 2009 4:08 PM To: jQuery (English) Subject: [jQuery] Re: Any trick to making text at has been faded in look good? Learned something

[jQuery] Re: i don´t know how add css to my html wit h jquery.

2009-01-11 Thread Kean
Do not use jQuery 1.2.5, use 1.2.6 instead. On Jan 11, 2:19 pm, Mauricio \(Maujor\) Samy Silva css.mau...@gmail.com wrote: The css() jQuery method has two sintaxes. For one css declaration use: $('#contenido').css('float', 'left'); For multiple css declarations use: $('#contenido').css ({

[jQuery] Re: mouseOut problem, tip not dissapearing

2009-01-07 Thread Kean
In the hide img function just call hide tip. On Jan 7, 8:53 am, i...@wenn.com i...@wenn.com wrote: We have a page that when you hover over images the tooltip shows, when you click on the image, the list of images is hidden but the tip seems to still say on the screen till i move mouse over

[jQuery] Re: event.preventDefault() not in the intellisense?

2009-01-04 Thread Kean
Hmm, sounds like a visual studio bug. Usually you just return false instead of doing e.preventDefault() when coding with jQuery. i.e. $('a').click(function(){ alert('clicked'); return false; // prevent default }); On Jan 3, 7:54 pm, yww yww...@gmail.com wrote: Hi I am new to this group

[jQuery] Re: How to force a child page to open in iframe using jquery

2009-01-04 Thread Kean
The site used a frame braker for a reason, which is, I do not want my site be in someone elses frame. Please respect that or contact that site admin. On Jan 4, 2:43 am, AbhishEk mithuabh...@gmail.com wrote: plz help On Fri, Jan 2, 2009 at 5:44 PM, AbhishEk mithuabh...@gmail.com wrote:

[jQuery] Re: jQuery way

2009-01-04 Thread Kean
This might be shorter. $(#container :not(#header, #content, #footer)).empty(); - Kean Tested with Sizzle but not jQuery 1.2.6 On Jan 4, 11:08 am, John Resig jere...@gmail.com wrote: Maybe: $(#container).children().not(#header, #content, #footer).empty(); --John On Sun, Jan 4, 2009 at 2

[jQuery] Re: what's wrong with $(:checkbox[checked=true]) ?

2008-12-31 Thread Kean
Correct me if I am wrong but I believe :checked works on checkboxes only, hence $(:checked) is sufficient. On Dec 31, 7:59 am, Karl Swedberg k...@englishrules.com wrote: not sure, but this works, too: $(:checkbox[checked]) --Karl Karl

[jQuery] Re: Problem link,href,tree, etc.

2008-12-31 Thread Kean
I think jQuery 1.3 will solve this problem by $('.teryt').live('click', (function(){ $('#miejscowosci-wybierz-wyniki').load($ (this).attr('href')); return false; }); }); On Dec 31, 10:35 am, Karl Swedberg k...@englishrules.com wrote: Not a problem at all. Glad to help.

[jQuery] Re: TESTING: replicate event bubbling in tests

2008-12-31 Thread Kean
$('#myScan').click() does not have event binded to it. It means fire myScan's click events, think very straightforward in this case. On the other hand, when you click on myScan it fires myDiv event because of bubbling. On Dec 31, 11:40 am, nachocab nacho...@gmail.com wrote: Hi, I was

[jQuery] Re: Coda Slider

2008-12-30 Thread Kean
Maybe try jFlow? http://www.gimiti.com/kltan/wordpress/?p=46 On Dec 30, 6:51 am, simonteu...@googlemail.com simonteu...@googlemail.com wrote: Hello jQuery Community I have a question about the Coda Slider. How can I create more than one Slider on one Webpage? The first works. But the

[jQuery] Re: Coda Slider

2008-12-30 Thread Kean
Yes, just add the class jFlowPrev to your previous button and class jFlowNext to your next button. View the demo source to get the rest. On Dec 30, 11:02 am, simonteu...@googlemail.com simonteu...@googlemail.com wrote: Hello Kean Is jFlow also offering the usage of arrows at the left

[jQuery] Re: REFACTOR: contents() with index() or indexOf()

2008-12-30 Thread Kean
$('itemsitemHello/itemitemworld/item!!item id=my_itemGoodnight moon!/item/items').find(#my_item).each (function(){ alert(this.innerHTML); }); Hmm I'd be interested to see how this can be done without using each On Dec 30, 12:07 pm, nachocab nacho...@gmail.com wrote: Actually that

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

2008-12-30 Thread Kean
Klaus is right, Here's an article about closure causing leaks http://www.javascriptkit.com/javatutors/closuresleak/index.shtml On Dec 30, 4:38 am, Alexandre Plennevaux aplennev...@gmail.com wrote: Klaus, you got me: frankly i have no real idea what is the purpose of enclosure. That's

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

2008-12-30 Thread Kean
A good reason why closure is used http://yuiblog.com/blog/2006/06/01/global-domination/ On Dec 30, 1:04 pm, Kean shenan...@gmail.com wrote: Klaus is right, Here's an article about closure causing leakshttp://www.javascriptkit.com/javatutors/closuresleak/index.shtml On Dec 30, 4:38 am

[jQuery] Re: REFACTOR: contents() with index() or indexOf()

2008-12-30 Thread Kean
I believe jQuery does not count/iterate textnode. Maybe there's a function in jQuery but I have no idea. On Dec 30, 12:52 pm, nachocab nacho...@gmail.com wrote: Thank you both, The only problem is that the right answer isn't 2, it's 3. I'm actually looking for the index of item#my_item inside

[jQuery] Interesting on document ready question

2008-12-30 Thread Kean
Is document ready actually an event handler? Let's say I have $(function(){ }); $(function(){ }); $(function(){ }); $(function(){ }); $(function(){ }); etc . around 5000 of those. Will it actually degrade performance like 5000 bind()? My guess is not much performance penalty, but

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

2008-12-30 Thread Kean
, 2008 at 10:10 PM, Kean shenan...@gmail.com wrote: A good reason why closure is used http://yuiblog.com/blog/2006/06/01/global-domination/ On Dec 30, 1:04 pm, Kean shenan...@gmail.com wrote: Klaus is right, Here's an article about closure causing leakshttp://www.javascriptkit.com

[jQuery] Re: $(document).ready fires before CSS is rendered?

2008-12-30 Thread Kean
I thought I saw an article covering this topic in learningjquery.com or somewhere else. Anyone care to show me where the article is?

[jQuery] Re: Interesting on document ready question

2008-12-30 Thread Kean
is a better way to do it. -Mike From: MorningZ If you've got 5000 of those, it's *seriously* time to reconsider your coding techniques.  depending on that much JavaScript is just plain old stupid.. On Dec 30, 8:59 pm, Kean shenan...@gmail.com wrote: Is document ready

[jQuery] Re: Fastest way to clear child elements from a div

2008-12-30 Thread Kean
Sounds like your nodes have to much element binded to them. On Dec 30, 1:00 pm, Adam Guichard amguich...@gmail.com wrote: It ran in 5ms, but its my understanding if I use the method your suggesting I'll be leaking memory.  If I just set the innerhtml = , I think the dom element's children

[jQuery] Re: Fastest way to clear child elements from a div

2008-12-30 Thread Kean
Oops I mean event. On Dec 30, 8:11 pm, Kean shenan...@gmail.com wrote: Sounds like your nodes have to much element binded to them. On Dec 30, 1:00 pm, Adam Guichard amguich...@gmail.com wrote: It ran in 5ms, but its my understanding if I use the method your suggesting I'll be leaking

[jQuery] Re: Interesting on document ready question

2008-12-30 Thread Kean
Hi Ricardo, Sweet, that's what I was expecting for an answer.

[jQuery] Re: Fastest way to clear child elements from a div

2008-12-30 Thread Kean
If I read the jQuery source code right, it seems that .html() does not use this replaceHTML method even in 1.3b1 On Dec 30, 8:21 pm, Ricardo Tomasi ricardob...@gmail.com wrote: There is a long discussion about better 'innerHTML' methods, see here (check the comments also):

[jQuery] Re: Please help me on a .lt method

2008-12-30 Thread Kean
Make a demo page or a html page. Some common mistakes 1. Did you include jQuery? 2. Did you write something like var $table =$('table') before using $table.find() ? On Dec 30, 7:30 pm, Samuel Wu samuel.yh...@gmail.com wrote: Hi, everyone I started writing jquery from last week with the

[jQuery] Re: Interesting on document ready question

2008-12-30 Thread Kean
Why do I really need so much on ready? Yes! That's what we're all wondering! Don't keep us in suspense. :-) When you work with a bunch of morons in a company that uses them throughout the site and when the js are packaged will lead to unnecessary performance loss.

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

2008-12-30 Thread Kean
As for JS, saving bytes is totally a good thing. On Dec 30, 10:53 pm, Alexandre Plennevaux aplennev...@gmail.com wrote: why? It's just a shorthand, isn't it ? does it affect the computer resources in any manner ? On Wed, Dec 31, 2008 at 3:12 AM, Kean shenan...@gmail.com wrote: Just

[jQuery] Re: Interesting on document ready question

2008-12-30 Thread Kean
5000 is just an exaggeration, it's probably in the realm of 20 On Dec 30, 10:42 pm, Kean shenan...@gmail.com wrote: Why do I really need so much on ready? Yes! That's what we're all wondering! Don't keep us in suspense. :-) When you work with a bunch of morons in a company that uses them

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

2008-12-30 Thread Kean
Alexandre, Another word of caution. Do choose your labels carefully. Avoid keywords. Adding quotes to keyword labels ensure compatibility with YUI compressor. var a = { // new without quotes produce error in ie new: function() { alert(new); }, //

[jQuery] Re: define and invoke class inside $(document).ready

2008-12-29 Thread Kean
Looks fine to me. Is myClass used in other places (ie outside of your document ready)? If so, you have to define it outside of document ready or do this window.myClass = function() { this.imagesHolder = null; } On Dec 29, 7:09 pm, bob xoxeo...@gmail.com wrote: Is that a correct way to

[jQuery] Re: getting the id of a clicked object

2008-12-29 Thread Kean
Try this then jQuery(function($){ $(a[class=clicker]).click(function() { alert(this.id); }); }); On Dec 29, 4:27 pm, buttman nbvf...@gmail.com wrote: That doesn't work. When I do alert(this.id) in that function, nothing comes up. Additionally, alert(this) just displays the url.

[jQuery] Re: getting the id of a clicked object

2008-12-29 Thread Kean
This is even better. jQuery(function($){ $(a.clicker).click(function() { alert(this.id); }); }); On Dec 29, 7:21 pm, Kean shenan...@gmail.com wrote: Try this then jQuery(function($){   $(a[class=clicker]).click(function() {     alert(this.id);   }); }); On Dec 29, 4:27 pm

[jQuery] Re: Event registered for a class does not work with all members of class

2008-12-29 Thread Kean
Yea, use clone(true) to copy the events. If you are using jQuery 1.3 beta you can try to use $(selector).live('event', function(){ }); live is like bind just that new nodes added to DOM will inherit the event. Well, this is a trick call event delegation. On Dec 29, 2:40 pm, Ricardo Tomasi

[jQuery] Re: Plugin that highlights divs

2008-12-29 Thread Kean
There's a plugin call jFade that will fade/highlight colors http://www.gimiti.com/kltan/wordpress/?p=43 On Dec 29, 1:22 pm, Tipem ti...@thedailyneopets.com wrote: Hi, I've seen a Jquery plugin before that triggers an event which pulsates or highlights a div of your choice.  I've also seen

[jQuery] Re: define and invoke class inside $(document).ready

2008-12-29 Thread Kean
You have to get the execution order right. this is just a declaration, to let javascript know that this function exists MyClass.prototype.init = function (){ this.imagesHolder = jQuery(#imgs); } jQuery(#imgs) is not executed until you do something like this. var a

[jQuery] Re: getting the id of a clicked object

2008-12-29 Thread Kean
to be inside the document.ready() thing, right? On Dec 29, 10:22 pm, Kean shenan...@gmail.com wrote: This is even better. jQuery(function($){    $(a.clicker).click(function() {      alert(this.id);    }); }); On Dec 29, 7:21 pm, Kean shenan...@gmail.com wrote: Try

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

2008-12-29 Thread Kean
Here's a few answers. 2. XmlHTTPrequest object, returns XHR request as obj or string, YUI callback augments object, jQuery callback augments string 4. http://www.json.org/ 5. block / inline 6. assume allLayer is array of layer1 and layer2 YAHOO.util.Dom.setStyle(allLayer, opacity, 66%);

[jQuery] Re: getting the id of a clicked object

2008-12-29 Thread Kean
Richardo, LOL

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

2008-12-29 Thread Kean
Concur with Michael, that's why I'd answered the obvious ones.

[jQuery] Re: Merry Xmass

2008-12-24 Thread Kean
Merry xmas to you too. On Dec 24, 5:20 am, Lukas Polak polak.luka...@gmail.com wrote: Hi everybody, I don't want you interrupt, but I don't know if you already notice that today is 24th December so at least today you shoold stop working and relax :) Merry Christmas to all of you :)

[jQuery] Re: How do I make a partial textarea autocomplete?

2008-12-24 Thread Kean
Interesting idea, but, owing to your idea, I am more interested in knowing if there's a way to determine current active keyboard cursor offset in document. On Dec 24, 1:26 am, Sam Unplugged guptasamee...@gmail.com wrote: Hello, Is there an example of partial autocomplete? By 'partial' I

[jQuery] Re: problem with fadein() and image sizes in IE

2008-12-24 Thread Kean
I hope you are using jQuery 1.2.6 Try these $(myImage).width(width); $(myImage).height(width/0.75); On Dec 23, 11:43 pm, Paddy Joy paddy...@gmail.com wrote: Hope someone can help out here, I'm new to jquery and can't figure out what I have done wrong here. The following code works ok in

[jQuery] Re: display:none not working in IE

2008-12-24 Thread Kean
You might have to look at your CSS if you have declared something like display: block !important; On Dec 24, 12:34 am, ben.hollis ben.hol...@gmail.com wrote: Guess you'll have to provide a more detailed example of the problem you're experiencing then. On Dec 24, 12:05 am, Namrata Vagyani

[jQuery] Re: Objected Expected $ Conflict?

2008-12-22 Thread Kean
Also for ids, it's better to write $('#item' + slideNum) than $('#carousel #item' + slideNum). On Dec 22, 6:19 am, MorningZ morni...@gmail.com wrote: Try replacing $ with jQuery and see if you get the same error (this will tell you if it's a conflict or something else) but it makes no

[jQuery] Re: attributes setting appending rather than clearing

2008-12-22 Thread Kean
Not sure the best way to do this, but this might work jQuery(function(){ var anotherFunction() { // your thing } var myFunction() { // do something $(this).bind('click', anotherFunction); $(this).unbind('click', myFunction); } $('a').bind('click', myFunction); }); On

[jQuery] Re: Smarter way to write this repetitive code?

2008-12-22 Thread Kean
j...@briskey.net wrote: and if you have _really_ a lot of elements... instead of a listener on each, just use one - var $hl = $('.headline'); $hl.click(function(e) {         $('.article-text').eq( $hl.index(e.target) ).fadeIn(); }); On Dec 21, 5:57 am, Kean shenan...@gmail.com wrote

[jQuery] Re: change element attribute, then have jquery act on that change?

2008-12-22 Thread Kean
Livequery and other event delegation techniques are cool, but, in a matter of simplicity pschwei1 , why don't you try the jQuery toggle event? I think it will definitely work for this case. http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C... On Dec 22, 2:34 pm, Dave Methvin

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Kean
try this, it accounts for checking all the required fields to see if they are blank and disable jQuery(function(){ // all the required text fields var $required = $('input.required:text'); // function checks for blank input var isBlank = function(str) {

[jQuery] Re: How can I generalize this code for all values?

2008-12-22 Thread Kean
be optimized to var checkAllRequired = function () { for (var i=0; i$required.length; i++) if (isBlank($required[i].value)) return false; return true; } On Dec 22, 5:26 pm, Kean shenan

[jQuery] Re: Smarter way to write this repetitive code?

2008-12-21 Thread Kean
Some performance improvement, especially if you have a lot of elements. var txt = $('.article-text'); $('.headline').each(function(i) { $(this).click(function() { $(txt[i]).fadeIn(); }) }); On Dec 20, 10:33 pm, chriscoyier chriscoy...@gmail.com wrote: Perfect! Thanks Ryura =) On

[jQuery] Re: Blank input value testing

2008-12-21 Thread Kean
Well blank() was not created in jQuery. You can create a new function for jQuery like this. (function($){ $.fn.blank = function(){ return $.trim(this[0]).length == 0; } })(jQuery) input id=one value=sadf / input id=two value= / $('#one').blank(); // return false $('#two').blank();

[jQuery] Re: problem in removing and moving

2008-12-21 Thread Kean
ul id=notDiv lib/b/li lib/b/li lib/b/li lib/bspan id=movingI am moving/span/li lib/b/li /ul If i am inserting into any li, regardless where my span#moving is in (ie. it can be in the third li, fifth li etc) var idx = 2; //place with other numbers

[jQuery] Re: Blank input value testing

2008-12-21 Thread Kean
My version plays nice if you have other libraries that take up the $ namespace (ie, prototype framework) On Dec 21, 7:50 am, Lay András lays...@gmail.com wrote: Hello! On Sun, Dec 21, 2008 at 3:09 PM, Kean shenan...@gmail.com wrote: Well blank() was not created in jQuery. You can

[jQuery] Re: Opening a popup question

2008-12-17 Thread Kean
var img_name = $('#bigimage_id_'.her_id).attr(src); I call attention to this '#bigimage_id_'.her_id Are you concatenating or what? Use + probably will solve the problem.

[jQuery] Re: Trigger same function from 2 different events

2008-12-17 Thread Kean
Try this I assume you used the word trigger NOT in a jQuery sense http://docs.jquery.com/Events/trigger#typedata jQuery(function($){ //document load/ready myHandler(); $('#button').click(myHandler); }); This code runs myHandler on document load. The code runs myHandler when #button is

[jQuery] Re: problem with dynamically setting attributes in IE7

2008-12-17 Thread Kean
Some questions I have 1. Did you use a debugger to assure that the attr is set in IE7 on the first place. 2. Provide some examples? 3. Did you use standard attributes? On Dec 15, 5:06 pm, RandyJohnson ra...@srpropertiesllc.net wrote: I have a jQuery routine that adds attributes to elements

[jQuery] Re: libraries

2008-12-17 Thread Kean
jQuery's API is intuitive by nature, you should learn by heart. On Dec 16, 5:41 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Ah now I see what you mean. You can download the extensions for Dreamweaver or IntelliSense

[jQuery] Re: Google Analytics breaks jQuery.

2008-12-17 Thread Kean
, Kean shenan...@gmail.com wrote: $(a).click(function(){   do something   // return false, this is jQuery's way of preventing default or bubbling   return false; }); Hope this helps On Dec 16, 11:51 am, simshaun simsh...@gmail.com wrote: I have a page where I am using

[jQuery] javascript namespacer

2008-12-17 Thread Kean
I wrote a simple namespacer. Do you think this is useful in real world applications? Any improvements that can be made to the code? Thank you. var namespace = function (name, global){ var root = global || '$'; (!eval('window.'+root))? eval('window.' + root + '={}') : '';

[jQuery] Re: javascript namespacer

2008-12-17 Thread Kean
= name[i];          data = data[ns] || ( data[ns] = {} );      }      return data; }; It'd a little get shorter if you use jQuery.each. Cheers -- Ariel Fleslerhttp://flesler.blogspot.com/ On Dec 17, 8:05 pm, Kean shenan...@gmail.com wrote: I wrote a simple namespacer. Do you think

[jQuery] Re: Optimized Code

2008-12-16 Thread Kean
It's interesting to know that $.map and $.grep can be used to a more generalized approach to this problem. Issya, you should look at Scott's code as it is extensible for future use. Definitely learned something new today. On Dec 15, 8:14 pm, Scott Sauyet li...@sauyet.com wrote: issya wrote: I

[jQuery] Re: Google Analytics breaks jQuery.

2008-12-16 Thread Kean
$(a).click(function(){ do something // return false, this is jQuery's way of preventing default or bubbling return false; }); Hope this helps On Dec 16, 11:51 am, simshaun simsh...@gmail.com wrote: I have a page where I am using jQuery's load function to inject HTML into a div

[jQuery] Re: Cluetip speed question

2008-12-16 Thread Kean
You most probably guess right on the CSS selector speed. Here's a link to read on CSS selector optimization. http://www.thegrubbsian.com/2008/10/optimize-jquery-selector-performance.html On Dec 16, 2:17 pm, David Morton morto...@gmail.com wrote: I am trying to use Cluetip to make a help text

  1   2   >