Forum Discussion
PerBonomi
Boss
Yeah, I probably don't want to do this. This thing is driving me nuts :)
I was trying before, to move the element with jquery, but no matter what kind of selector Iuse, it just won't budge.
I now have this:
<#assign msgId = env.context.message.id /> <@delegate /> <div id="custom-${msgId}" style="display:none">your content here</div> <@liaAddScript> ;(function($) { LITHIUM.Loader.onLoad(function(){ $("#messageview .message-uid-${msgId}").find(".lia-message-author-rank").append("#custom-${msgId}"); $("#custom-${msgId}").css("display", "block"); }); })(LITHIUM.jQuery); </@liaAddScript>
I've tried with parent(), children(), first(), this().parent().;anything I could think of, it just doesn't move an inch. It almost feels like the author section is getting some magical protection.
NicoB
11 years agoLithium Alumni (Retired)
HI PerBonomi
I just spent a good hour trying to fix the same issue :)
Try replacing this:
$("#messageview .message-uid-${msgId}").find(".lia-message-author-rank").append("#custom-${msgId}");
with this:
$("#messageview .message-uid-${msgId}").find(".lia-message-author-rank").append($("#custom-${msgId}"));
You're basically passing a string to append while you should pass a jQuery object.
Nico
Related Content
- 2 years ago
- 2 years ago