[jQuery] Re: Custom function called in toogle()

2007-11-06 Thread Snook
Didn't works either ... Here is the solution I had found. Instead use the toggle() function, which cause this issue, I use the click() function with an if() statement. function myToggle(checkboxElem, showHideElem){ var showHide = $(showHideElem); var checkbox = $(

[jQuery] Re: Custom function called in toogle()

2007-11-05 Thread Wizzud
Yeah, it was a bit thoughtless of me to suggest it (tired!). Try this instead...(untested)... function myToggle(toggleElem, showHideElem){ var showHide = $(showHideElem); $(toggleElem).toggle( function(){ showHide.show('slow'); toggleElem.checked = ! toggleElem.checked; }, function(){

[jQuery] Re: Custom function called in toogle()

2007-11-05 Thread Snook
I also have tried, like you suggested, to use the .each() function. function myToggle(toggleElem, showHideElem){ var showHide = $(showHideElem); $(toggleElem).toggle( function(){ showHide.show('slow');}, function(){ showHide.hide('slow');}

[jQuery] Re: Custom function called in toogle()

2007-11-05 Thread Snook
Sorry Wizzud, but your code didn't works either, the checkbox is checked every time. I have also try in different way like this and this make me crazy !: function myToggle(toggleElem, showHideElem){ var showHide = $(showHideElem); $(toggleElem).toggle( function(){

[jQuery] Re: Custom function called in toogle()

2007-11-02 Thread Wizzud
function myToggle(toggleElem, showHideElem){ var showHide = $(showHideElem); $(toggleElem).toggle( function(){ showHide.show('slow'); }, function(){ showHide.hide('slow'); } ) .each(function(){ this.checked = !this.checked; }); } On Nov 2, 12:21 pm, Snook <[EMAIL PROTECTED]> wrote

[jQuery] Re: Custom function called in toogle()

2007-11-02 Thread Snook
> Calling toggle() runs event.preventDefault. > Whatever you want the click to do, you need to code it yourself. Ok, thanks. I have tried different implementation of preventDefault, regarding what I have found in this group. And probably I'm completely wrong because no one works for me. Here is

[jQuery] Re: Custom function called in toogle()

2007-11-01 Thread Wizzud
Calling toggle() runs event.preventDefault. Whatever you want the click to do, you need to code it yourself. On Nov 1, 9:44 am, Snook <[EMAIL PROTECTED]> wrote: > Thanks a lot Wizzud. This works fine. > > But did you have an idea why the checkbox didn't display the check > mark when there are che

[jQuery] Re: Custom function called in toogle()

2007-11-01 Thread Snook
Thanks a lot Wizzud. This works fine. Regards, Damien

[jQuery] Re: Custom function called in toogle()

2007-11-01 Thread Snook
Thanks a lot Wizzud. This works fine. But did you have an idea why the checkbox didn't display the check mark when there are checked ? The checkbox are used to run the toggle function. Damien

[jQuery] Re: Custom function called in toogle()

2007-10-31 Thread Wizzud
Something along the lines of ...? function myToggle(toggleElem, showHideElem){ var showHide = $(showHideElem); $(toggleElem).toggle( function(){ showHide.show('slow'); }, function(){ showHide.hide('slow'); } ); } myToggle('#regime_ltn_c', '#regime_ltn'); On Oct 31, 2:51 pm, Snook <[E