Thank you all for your input into this query.
@Jack - I appreciate your guidance re style
@mkmanning - thanks for your solution - it lead me to one I needed;
due to my poor description, your solution (as I read it) took ALL the
content of the parent p, wrapped it in the div and inserted it
i would usually wrap anything effected by jquery within a div
script
var obj = $(.pcontainer img);
var nav = obj.parent();
nav = nav .parent();
nav.prepend(obj);
obj.remove();
/script
div class=wrap
p class=pcontainer
img src=coffee.jpg border=0 /
/p
/dvi
On Sat, Jun 6, 2009 at 11:11 PM,
wasseem's answer looks good, I'd just like to off a little friendly
advice on coding style, advice meant to make revisiting
your own code in the future easier as well as making it under-
standable to others.
in a block like:
{
var a= $(this).attr('alt');
...
}
consider
One reason I follow this board is to learn how to do things I haven't
encountered. I had no idea off top of my head how to do what you want
but in quest to learn jQuery many of the problems on this board are
great for training one's self. Thanks to team jQuery for such a good
library and for
Waseem's answer doesn't look good for a couple reasons, most
importantly calling obj.remove(). That will delete the image from the
DOM, which renders every action before it pretty useless :P
It also doesn't take into account the OP's request to also include the
caption text if it exists.
Try
This still won't move the optional caption text (see my post above).
On Jun 6, 4:21 pm, Charlie charlie...@gmail.com wrote:
One reason I follow this board is to learn how to do things I haven't
encountered. I had no idea off top of my head how to do what you want but in
quest to learn
i did realize after reading your post my bad for not paying closer
attention to the OP, wrapping it all first then moving out of p makes
sense
mkmanning wrote:
This still won't move the optional caption text (see my post above).
On Jun 6, 4:21pm, Charlie charlie...@gmail.com wrote:
7 matches
Mail list logo