[opencms-dev] cms:container included content and jquery ready
Filip Kratochvil
filip.kratochvil at nelasoft.cz
Mon Oct 20 11:58:34 CEST 2014
Hi Lisa,
try to include scripts/styles in to the head using headicludes tag in your
XSD:
http://www.opencms-wiki.org/wiki/The_OpenCms_8_Demo_Template_Modules_in_Deta
il#Headinclude_tag_demo
But there can be one reason: Your code should be placed in one div
Bad Example:
<div class="box">
<div class="init">darkside</div>
</div>
<script>
$(document).ready(function() {
});
</script>
Good Example:
<div class="box">
<div class="box-content">darkside</div>
<script>
$(document).ready(function() {
});
</script>
</div>
It´s not possible to init "box" in this example of course.
--
Regards
Filip Kratochvil
------------------------------------------------
NELASOFT Technologies, s.r.o.
E-mail: <mailto:filip.kratochvil at nelasoft.cz> filip.kratochvil at nelasoft.cz
Web: <http://www.nelasoft.cz> www.nelasoft.cz
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of lruggeri at maticad.it
Sent: Monday, October 20, 2014 10:57 AM
To: 'The OpenCms mailing list'
Subject: [opencms-dev] cms:container included content and jquery ready
Hi,
I have an opencms 8.5.2 template which includes some content using
cms:container tags
The included content contains javascript code wrapped into
$(document).ready() jquery function.
My problem is that the ready event is firing before the html content of one
the cms:container tags is loaded, breaking the javascript code.
I would like to know if anyone encountered this issue, and if there is a
workaround.
Does cms:container generates javascript in order to include its contents?
It's the only explanation I can find but it does make much sense to me.
Bye, Lisa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20141020/d4dbe7cd/attachment.htm>
More information about the opencms-dev
mailing list