[jQuery] Re: click(function{ problem with Firefox

2009-12-24 Thread Šime Vidas
Yea, that happens if you don't follow the standard some browser will break your code :) For a comprehensive overview of propper HTML nesting rules, consult my diagram: http://vidasp.net/HTMLstructure.htm

[jQuery] Re: click(function{ problem with Firefox

2009-12-24 Thread turnavies
Thanks for your replies! FF is happy now, although it's not fully standards-compliant (I still have an img inside my label), but the code is a lot cleaner and it works on the major browsers (haven't tested IE though :D) Nice diagram! Thomas

[jQuery] Re: click(function{ problem with Firefox

2009-12-24 Thread turnavies
ah look at that, img is an inline element :D standards ftw! On 24 dec, 23:10, turnavies thomas.vanoeke...@gmail.com wrote: Thanks for your replies! FF is happy now, although it's not fully standards-compliant (I still have an img inside my label), but the code is a lot cleaner and it works on

[jQuery] Re: click function populating value in a hidden field

2009-10-01 Thread James
Suppose your rows looked like this: tr id=row_1tdtext/td/tr tr id=row_2tdtext/td/tr tr id=row_3tdtext/td/tr $(tr).click(function () { $(.clicked).removeClass(clicked); $(this).addClass(clicked); var row_id = this.id.split('_')[1]; // e.g. 2 $(#hiddenField).val(row_id); //

[jQuery] Re: click function populating value in a hidden field

2009-10-01 Thread Chuk
Works like a charm! Thanks so much! :)

[jQuery] Re: click function populating value in a hidden field

2009-10-01 Thread Chuk
Works like a charm! Thanks so much! :)

[jQuery] Re: click function populating value in a hidden field

2009-10-01 Thread Chuk
Works like a charm! Thanks so much! :)

[jQuery] Re: click function on anchor element

2009-06-11 Thread Pierre Bellan
Hi, I think that is because of the alert function. It needs a string and maybe for an anchor object, jquery introduces a toString method. With the console of firebug, there are no differences between anchor and images Pierre 2009/6/11 bensan...@gmail.com bensan...@gmail.com Hi all, I'm

[jQuery] Re: click function on anchor element

2009-06-11 Thread Chandan Luthra
Hi Bensanlau, try $('a').click(function(){ alert(*$(this)*); return false; }); Chandan Luthra Intelligrape Software Pvt. Ltd. Josh Billingshttp://www.brainyquote.com/quotes/authors/j/josh_billings.html - Every man has his follies - and often they are the most interesting thing he has got. On

[jQuery] Re: click function on anchor element

2009-06-11 Thread Ricardo
Just clearing up what Pierre said: if the argument you passed to alert () is not a string, it's .toString() method will be called. For convenience, the toString on an anchor HTMLElement object returns it's href. Try this: $('a').get(0).toString(); or $('a').click(function(){ alert(

[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: .click function won't work twice? addClass and hasClass little problem

2009-05-19 Thread James
I think you want this: if($(#content).hasClass(blue)) { $(#content).removeClass(blue); $(#content).addClass(red); } if($(#content).hasClass(red)) {

[jQuery] Re: click(function() works only once per page load?

2009-03-29 Thread Mr. Zeph
Thanks On Sun, Mar 29, 2009 at 1:25 AM, Ricardo ricardob...@gmail.com wrote: That's as simple as changing $(.ajax_homes_primary_img).click (function(){ to $(.ajax_homes_primary_img).live('click', function() Thanks, tried it, and even used livequery (amazing how fast this stuff is to pick

[jQuery] Re: click(function() works only once per page load?

2009-03-28 Thread Ricardo
Your click handler only applies to the elements matching .ajax_homes_primary_img at the time the click() function is called. When you replace it, the new element has no event listeners attached. You can either rebind the event every time you modify it, or use the 'live' function, which uses event

[jQuery] Re: Click function dosen't work, after append new html data.

2009-03-11 Thread errant
That's because events are binded to existing elements. If you're using 1.3.x, take a look at live method: http://docs.jquery.com/Events/live#typefn. With previous versions, livequery plugin may be helpful: http://docs.jquery.com/Plugins/livequery On 11 мар, 09:25, sure sure.2...@gmail.com

[jQuery] Re: Click function dosen't work, after append new html data.

2009-03-11 Thread sure
Hi errant, Thank you very much for quick reply. Now it works good using live method. Your solution saves my lot of time. with Regards sure. On Mar 11, 1:32 pm, errant d.cheka...@gmail.com wrote: That's because events are binded to existing elements. If you're using 1.3.x, take a

[jQuery] Re: click(function) in an iframe

2009-01-08 Thread Janis
You can place transparent div on top of iframe

[jQuery] Re: click function

2008-12-15 Thread theCrandallSter
I am not exactly sure what you are doing with the positioning, but try .toggle() instead perhaps? Cheers On Dec 15, 11:13 am, Alfredo Alessandrini alfreal...@gmail.com wrote: I've a simple question.. I'm writing a function that call an event on first mouse click and call another event on

[jQuery] Re: click function

2008-12-15 Thread Kean
Here's exactly the function that you need. http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C... On Dec 15, 8:56 am, theCrandallSter thecrandalls...@gmail.com wrote: I am not exactly sure what you are doing with the positioning, but try .toggle() instead perhaps? Cheers On Dec 15,

[jQuery] Re: click function doesn't work on html element created on the fly with jquery

2008-12-04 Thread brian
That's because the element did not exist when you assigned the click handler. Have a look at the liveQuery plugin [1] or otherwise make sure that any newly-created elements are given notice of how the're supposed to act when you introduce them to the document. [1]

[jQuery] Re: click function doesn't work on html element created on the fly with jquery

2008-12-04 Thread Mike Alsup
That's because the element did not exist when you assigned the click handler. Have a look at the liveQuery plugin [1] or otherwise make sure that any newly-created elements are given notice of how the're supposed to act when you introduce them to the document.

[jQuery] Re: click function doesn't work on html element created on the fly with jquery

2008-12-04 Thread fabrice.regnier
Hi, Thanx for the tip ;) I realize now it's a common problem with jquery. You talked about LiveQuery. According to you, what is the main difference with the quite new plugin LiveBind ? otherwise make sure that any newly-created elements are given notice of how the're supposed to act when

[jQuery] Re: click function

2008-09-28 Thread BB
You don't need .val() just: $(this).attr(alt) Please write some more code, because at the moment I think it is all right. On 28 Sep., 17:21, SeanJA [EMAIL PROTECTED] wrote: $(.status_actions img).click(function(){         console.log(clicked!);         console.log($(this).attr(alt).val());

[jQuery] Re: click function

2008-09-28 Thread SeanJA
For some reason though it doesn't even do the first console.log $(.status_actions img).click(function(){ console.log(clicked!); }); nor will it do alert or anything else... On Sep 28, 1:42 pm, BB [EMAIL PROTECTED] wrote: You don't need .val() just: $(this).attr(alt) Please write

[jQuery] Re: click function

2008-09-28 Thread SeanJA
For some reason it doesnt even do the first console.log though... On Sep 28, 1:42 pm, BB [EMAIL PROTECTED] wrote: You don't need .val() just: $(this).attr(alt) Please write some more code, because at the moment I think it is all right. On 28 Sep., 17:21, SeanJA [EMAIL PROTECTED] wrote:

[jQuery] Re: click function

2008-09-28 Thread ricardobeat
I bet the length of the object being returned is 0. Is your selector right? If you could post a test page it would be much easier for someone to help! - ricardo On Sep 28, 5:30 pm, SeanJA [EMAIL PROTECTED] wrote: For some reason it doesnt even do the first console.log though... On Sep 28,

[jQuery] Re: Click function only invoked after second click in IE6 IE7

2008-09-26 Thread RLR
I did not fully realize the issue with the duplication of the ids from Thomas first post... Now I understand and have a working example to base my code on. Thank you very much for your help Richardo and Thomas.

[jQuery] Re: Click function only invoked after second click in IE6 IE7

2008-09-25 Thread thomas peklak
Your document contains multiple same ids (info, info_link). This is not valid (http://validator.w3.org/check?verbose=1uri=http:// dev.dreimorgen.com/test.html). Please correct this first (use classes instead) and try again. For me this is working. Thomas

[jQuery] Re: Click function only invoked after second click in IE6 IE7

2008-09-25 Thread RLR
Thanks for the hint Thomas. I revised the code so that it validates correctly now. And I stripped it down to a minimalist version to show my point. Click item 1 - toggle link appears click on toggle link (IE6/IE7 do not toggle the content whereas Safari FF do on the first time) Click item 1

[jQuery] Re: Click function only invoked after second click in IE6 IE7

2008-09-25 Thread ricardobeat
When you copy the content with jQuery('#content').html(content); you're still duplicating the #item1_content_info ID, that's the source of your problems. I took the liberty to duplicate your page and alter the script (working in IE): http://ff6600.org/j/toggle.htm or for a more semantic

[jQuery] Re: click function doesn't work on dynamic content?

2008-06-06 Thread Jon Reed
Might be worth looking into the livequery plugin too J On Jun 6, 1:43 am, Richard D. Worth [EMAIL PROTECTED] wrote: Take a look at: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... If I've understood you're problem, it's a fairly common one that stems from the fact

[jQuery] Re: click function doesn't work on dynamic content?

2008-06-06 Thread Ariel Flesler
That article in the FAQ does mention LiveQuery. -- Ariel Flesler http://flesler.blogspot.com On 6 jun, 05:56, Jon Reed [EMAIL PROTECTED] wrote: Might be worth looking into the livequery plugin too J On Jun 6, 1:43 am, Richard D. Worth [EMAIL PROTECTED] wrote: Take a look at:

[jQuery] Re: click function doesn't work on dynamic content?

2008-06-05 Thread Richard D. Worth
Take a look at: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F If I've understood you're problem, it's a fairly common one that stems from the fact that you're adding a new element (with append('li ...) that has no click event bound to

[jQuery] Re: click(function(select) help

2008-05-05 Thread motob
elle, Since you're going to have 8 fieldsets, why don't you have some code that will automatically close all of them when the change function is called, then you can use a variable as your jQuery selector so you don't have to use an IF statement. You could do something like this.

[jQuery] Re: click(function(select) help

2008-05-02 Thread elle
@Dave: when I selected the first product it showed me its options. Changing an option didn't do a thing. Clicking again on first product, hid its options. @motob: I used this instead: $(.product-type).change(function(){ if($(this).val() == filters){

[jQuery] Re: click(function(select) help

2008-05-01 Thread Dave Methvin
$('#orderform').find('.options').hide(); $('.product-type').find('option.producta').click(function(select) { $('fieldset.producta').slideDown(slow); }); $('.product-type').find('option.productb').click(function(select) {

[jQuery] Re: click(function(select) help

2008-05-01 Thread motob
Instead of adding click listeners to the option elements, add a change listener to the overall select menu. Once the change event is fired, determine which value is choosen, then show/hide the appropriate option fieldset. NOTE: You may want to change the values of the option elements so that they