[jQuery] Re: .clone not work in FF or IE, please help
jQuery.clone(true) will only clone the events that it knows about ... in other words ... it clones the events it bound. -- Brandon Aaron On Jan 29, 10:35 am, chrismarx <[EMAIL PROTECTED]> wrote: > should clone also work for behaviors that were not added by jquery? > (like a google map?) i tried to clone a div with a google map, and > although clone successfully copied all the elements, the behaviors > were lost. append did the job for a workaround. should clone(true) be > able to also grab all the associated behavior from child elements? > > On Jan 29, 10:13 am, Eridius <[EMAIL PROTECTED]> wrote: > > > my code: > > > var append_to = self.element.children('.cr_tab_content'); > > var clone_element = self.element.children('#' + id).clone(true) > > $(clone_element).appendTo(append_to); > > > When I do this my element is still empty but should be filled with the > > cloned element > > > var append_to = self.element.children('.cr_tab_content'); > > var clone_element = self.element.children('#' + id).clone(true) > > $(append_to).append(element.html()); > > > work fine but I want to make sure and events are carried over. any help > > please? > > -- > > View this message in > > context:http://www.nabble.com/.clone-not-work-in-FF-or-IE%2C-please-help-tp15... > > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: .clone not work in FF or IE, please help
What version of jQuery are you using? Are you getting an error message? Are you trying to clone a table row? jQuery 1.2.2 has a known issue with cloning a table row and a few other elements. The current SVN and jQuery 1.2.3a resolves this issue. Please try using jQuery 1.2.3a to see if that resolves the issue you are having. Otherwise, see if you can create an example for us to look at. -- Brandon Aaron On Jan 29, 9:13 am, Eridius <[EMAIL PROTECTED]> wrote: > my code: > > var append_to = self.element.children('.cr_tab_content'); > var clone_element = self.element.children('#' + id).clone(true) > $(clone_element).appendTo(append_to); > > When I do this my element is still empty but should be filled with the > cloned element > > var append_to = self.element.children('.cr_tab_content'); > var clone_element = self.element.children('#' + id).clone(true) > $(append_to).append(element.html()); > > work fine but I want to make sure and events are carried over. any help > please? > -- > View this message in > context:http://www.nabble.com/.clone-not-work-in-FF-or-IE%2C-please-help-tp15... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: .clone not work in FF or IE, please help
you said your code copied the element correctly, but mine is not. do you see anything wrong with my code that would make my element it should be coping to data empty? chrismarx wrote: > > > should clone also work for behaviors that were not added by jquery? > (like a google map?) i tried to clone a div with a google map, and > although clone successfully copied all the elements, the behaviors > were lost. append did the job for a workaround. should clone(true) be > able to also grab all the associated behavior from child elements? > > On Jan 29, 10:13 am, Eridius <[EMAIL PROTECTED]> wrote: >> my code: >> >> var append_to = self.element.children('.cr_tab_content'); >> var clone_element = self.element.children('#' + id).clone(true) >> $(clone_element).appendTo(append_to); >> >> When I do this my element is still empty but should be filled with the >> cloned element >> >> var append_to = self.element.children('.cr_tab_content'); >> var clone_element = self.element.children('#' + id).clone(true) >> $(append_to).append(element.html()); >> >> work fine but I want to make sure and events are carried over. any help >> please? >> -- >> View this message in >> context:http://www.nabble.com/.clone-not-work-in-FF-or-IE%2C-please-help-tp15... >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. > > -- View this message in context: http://www.nabble.com/.clone-not-work-in-FF-or-IE%2C-please-help-tp15160495s27240p15163862.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: .clone not work in FF or IE, please help
should clone also work for behaviors that were not added by jquery? (like a google map?) i tried to clone a div with a google map, and although clone successfully copied all the elements, the behaviors were lost. append did the job for a workaround. should clone(true) be able to also grab all the associated behavior from child elements? On Jan 29, 10:13 am, Eridius <[EMAIL PROTECTED]> wrote: > my code: > > var append_to = self.element.children('.cr_tab_content'); > var clone_element = self.element.children('#' + id).clone(true) > $(clone_element).appendTo(append_to); > > When I do this my element is still empty but should be filled with the > cloned element > > var append_to = self.element.children('.cr_tab_content'); > var clone_element = self.element.children('#' + id).clone(true) > $(append_to).append(element.html()); > > work fine but I want to make sure and events are carried over. any help > please? > -- > View this message in > context:http://www.nabble.com/.clone-not-work-in-FF-or-IE%2C-please-help-tp15... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.