[jQuery] Re: Replacing contents using an array

2007-12-02 Thread Mali
Thanks all, You guys are legends!. All solutions are usefull but I found the first one from Lee is easier for me to understand as I am still new to this. I have to keep practicing to catch you up!. merry christmas. Regards, Mali On Dec 2, 2:19 am, "Jake McGraw" <[EMAIL PROTECTED]> wrote: > Her

[jQuery] Re: Replacing contents using an array

2007-12-01 Thread Jake McGraw
Here's a solution I think you'll find helpful: JavaScript: Trans = { "t1":"New Text 1", "t2":"New Text 2", "t3":"New Text 3" }; $(function(){ $("#newText, #oldText").click(function(){ if ($(this).is(".active")) {return;} $("a").each(function(){ if (Trans

[jQuery] Re: Replacing contents using an array

2007-12-01 Thread Mali
Hello Lee, It's work like a charm!! :) thank you very much for your help. I'll study this more. It's fun! Regards, Mali On Dec 1, 11:47 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi Mali, > > Try this instead: > I'm still fairly new to jQuery (1 week), so I'm sure there must be an > e

[jQuery] Re: Replacing contents using an array

2007-12-01 Thread Wizzud
An alternative? $(document).ready(function(){ var txtLinks = $('a'); // change selector to suit var txts = { newText: ["My new text A","My new text B","My new text C","My new text D","My new text E","My new text F"] , oldText: $.map(txtLinks, function(v,i){ return $ (v).t

[jQuery] Re: Replacing contents using an array

2007-12-01 Thread [EMAIL PROTECTED]
Hi Mali, Try this instead: I'm still fairly new to jQuery (1 week), so I'm sure there must be an even shorter way... $(function() { $("#newText").click(function(){ $('#myList a').each(function(x){ if (!this.origText) {