Pablo Courault
2015-08-20 21:14:57 UTC
Hi everyone
I've been trying to add javascript to hide or show a <div> tag with
additional information on news-xmlui.xml, on 5.2 Dspace version.
I put the code in a function that changes the display attribute css in
page-structure.xsl; and the link that calls the function in a xref label but
can not get it to work.
In the page-structure.xsl the code of the function is:
In news-xmlui.xml
The code is:
<div>
<xref="javascript:ShowHide('info1');"> Show Hidden Div </xref>
</div>
<div class='hiddendiv' id="info1">
<p>
Lorem ipsum ad his scripta blandit partiendo, eum fastidii accumsan
euripidis in, eum liber hendrerit an. Qui ut wisi
vocibus suscipiantur, quo dicit ridens inciderint id.
</p>
</div>
But when i see the page code generated, i can see two things:
<div class="notice failure">JavaScript is disabled for your browser. Some
features of this site may not work without it.</div>
(but in other tabs with pages containing javascript works perfectly)
And the other code is:
<div class="ds-static-div">
Show Hidden Div (no function appears javascript)
</div>
<div id="info1" class="ds-static-div"> (change the class type)
<p class="ds-paragraph"> bla bla bla </p>
</div>
Thanks in advance for any thoughts or insights anyone might have.
Cheers,
Lic. Pablo Courault
Universidad Nacional del Litoral
Santa Fe
Argentina
--
View this message in context: http://dspace.2283337.n4.nabble.com/Add-JavaScript-on-news-xmlui-xml-or-Hide-and-show-contens-on-Dspace-5-2-tp4679299.html
Sent from the DSpace - Tech mailing list archive at Nabble.com.
------------------------------------------------------------------------------
I've been trying to add javascript to hide or show a <div> tag with
additional information on news-xmlui.xml, on 5.2 Dspace version.
I put the code in a function that changes the display attribute css in
page-structure.xsl; and the link that calls the function in a xref label but
can not get it to work.
In the page-structure.xsl the code of the function is:
In news-xmlui.xml
The code is:
<div>
<xref="javascript:ShowHide('info1');"> Show Hidden Div </xref>
</div>
<div class='hiddendiv' id="info1">
<p>
Lorem ipsum ad his scripta blandit partiendo, eum fastidii accumsan
euripidis in, eum liber hendrerit an. Qui ut wisi
vocibus suscipiantur, quo dicit ridens inciderint id.
</p>
</div>
But when i see the page code generated, i can see two things:
<div class="notice failure">JavaScript is disabled for your browser. Some
features of this site may not work without it.</div>
(but in other tabs with pages containing javascript works perfectly)
And the other code is:
<div class="ds-static-div">
Show Hidden Div (no function appears javascript)
</div>
<div id="info1" class="ds-static-div"> (change the class type)
<p class="ds-paragraph"> bla bla bla </p>
</div>
Thanks in advance for any thoughts or insights anyone might have.
Cheers,
Lic. Pablo Courault
Universidad Nacional del Litoral
Santa Fe
Argentina
--
View this message in context: http://dspace.2283337.n4.nabble.com/Add-JavaScript-on-news-xmlui-xml-or-Hide-and-show-contens-on-Dspace-5-2-tp4679299.html
Sent from the DSpace - Tech mailing list archive at Nabble.com.
------------------------------------------------------------------------------