What does your html look like? Is .mydivcontainer the immediate parent of
.mydiv?
- Richard
On Tue, May 19, 2009 at 7:20 AM, aly he...@digitalnature.ro wrote:
I'm trying to move a set of divs into their parent elements.
Currently I'm using:
jQuery('.mydiv').each(function(){
And what is it you're trying to do exactly? I have to say I was caught
curious by your subject 'Move element to parent div'. Where would an element
be, if not inside its parent? Are you just trying to move it up to be the
first child of the parent, by prependTo?
I wonder if in the first case,
thanks for your reply.
html is something like:
div class=mydivcontainer
...
div class=mydiv
...
/div
/div
there are more elements where I placed the (...) dots, but I guess it
doesn't matter since parent('.mydivcontainer') should locate the
target element.
and yes, what I am trying
On Tue, May 19, 2009 at 10:48 AM, aly he...@digitalnature.ro wrote:
thanks for your reply.
html is something like:
div class=mydivcontainer
...
div class=mydiv
...
/div
/div
there are more elements where I placed the (...) dots, but I guess it
doesn't matter since
it seems that parent('...') is the problem...
the code works only if I specify the name of the target div:
jQuery(document).ready(function(){
jQuery(.mydivcontainer).prependTo('.mydiv'');
});
but this is useless in my case because I have multiple and dynamic
items with that class...
How about (untested):
$(this).parent().prepend(this)
?
- Richard
On Tue, May 19, 2009 at 1:29 PM, aly he...@digitalnature.ro wrote:
it seems that parent('...') is the problem...
the code works only if I specify the name of the target div:
jQuery(document).ready(function(){
doesnt work. I get:
Error: [Exception... Node cannot be inserted at the specified point
in the hierarchy code: 3 .
On 19 Mai, 20:43, Richard D. Worth rdwo...@gmail.com wrote:
How about (untested):
$(this).parent().prepend(this)
?
- Richard
On Tue, May 19, 2009 at 1:29 PM, aly
found it:
jQuery(this).prependTo(this.parentNode) works!
thanks
On 19 Mai, 20:43, Richard D. Worth rdwo...@gmail.com wrote:
How about (untested):
$(this).parent().prepend(this)
?
- Richard
On Tue, May 19, 2009 at 1:29 PM, aly he...@digitalnature.ro wrote:
it seems that
8 matches
Mail list logo