„Sablon:Kísérleti fizika gyakorlat” változatai közötti eltérés
a |
(Szkript végeredmények megjelenítéséhez, rejtéséhez, még UL nódusnév cserélendő) |
||
1. sor: | 1. sor: | ||
+ | <script type="text/javascript"> | ||
+ | function showHintToggle() { | ||
+ | if ( document.createTextNode ) { | ||
+ | // Uses DOM calls to avoid document.write + XHTML issues | ||
+ | |||
+ | var arr_linkHolder = document.getElementsByClassName( 'hinttitle' ); | ||
+ | var existingLink = document.getElementsByClassName( 'togglelink' ); | ||
+ | if ( !arr_linkHolder|| existingLink ) { | ||
+ | // Don't add the toggle link twice | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | for(i=0; i<arr_linkHolder.length; i++) | ||
+ | { | ||
+ | |||
+ | var outerSpan = document.createElement( 'span' ); | ||
+ | outerSpan.className = 'hinttoggle'; | ||
+ | |||
+ | var toggleLink = document.createElement( 'a' ); | ||
+ | toggleLink.id = 'togglelink'+i; | ||
+ | toggleLink.className = 'internal'; | ||
+ | toggleLink.href = 'javascript:toggleHint('+i+')'; | ||
+ | toggleLink.appendChild( document.createTextNode( hintHideText ) ); | ||
+ | |||
+ | outerSpan.appendChild( document.createTextNode( '[' ) ); | ||
+ | outerSpan.appendChild( hintLink ); | ||
+ | outerSpan.appendChild( document.createTextNode( ']' ) ); | ||
+ | |||
+ | arr_linkHolder[i].appendChild( document.createTextNode( ' ' ) ); | ||
+ | arr_linkHolder[i].appendChild( outerSpan ); | ||
+ | |||
+ | var cookiePos = document.cookie.indexOf( "hidehint=" ); | ||
+ | if ( cookiePos > -1 && document.cookie.charAt( cookiePos + 8 ) == 1 ) { | ||
+ | toggleHint(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleHint(num) { | ||
+ | var hintmain = document.getElementById( 'hint'+num ); | ||
+ | var hint = document.getElementById('hint'+num).getElementsByTagName('ul')[0]; | ||
+ | var toggleLink = document.getElementById( 'togglelink' ); | ||
+ | |||
+ | if ( hint && toggleLink && hint.style.display == 'none' ) { | ||
+ | changeText( toggleLink, hintHideText ); | ||
+ | hint.style.display = 'block'; | ||
+ | //document.cookie = "hidehint=0"; | ||
+ | hintmain.className = 'hint'; | ||
+ | } else { | ||
+ | changeText( toggleLink, hintShowText ); | ||
+ | hint.style.display = 'none'; | ||
+ | //document.cookie = "hidehint=1"; | ||
+ | hintmain.className = 'hint tochidden'; | ||
+ | } | ||
+ | } | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- |
A lap 2012. június 19., 22:13-kori változata
<script type="text/javascript"> function showHintToggle() { if ( document.createTextNode ) { // Uses DOM calls to avoid document.write + XHTML issues
var arr_linkHolder = document.getElementsByClassName( 'hinttitle' ); var existingLink = document.getElementsByClassName( 'togglelink' ); if ( !arr_linkHolder|| existingLink ) { // Don't add the toggle link twice return; }
for(i=0; i<arr_linkHolder.length; i++) {
var outerSpan = document.createElement( 'span' ); outerSpan.className = 'hinttoggle';
var toggleLink = document.createElement( 'a' ); toggleLink.id = 'togglelink'+i; toggleLink.className = 'internal'; toggleLink.href = 'javascript:toggleHint('+i+')'; toggleLink.appendChild( document.createTextNode( hintHideText ) );
outerSpan.appendChild( document.createTextNode( '[' ) ); outerSpan.appendChild( hintLink ); outerSpan.appendChild( document.createTextNode( ']' ) );
arr_linkHolder[i].appendChild( document.createTextNode( ' ' ) ); arr_linkHolder[i].appendChild( outerSpan );
var cookiePos = document.cookie.indexOf( "hidehint=" ); if ( cookiePos > -1 && document.cookie.charAt( cookiePos + 8 ) == 1 ) { toggleHint(); } } } }
function toggleHint(num) { var hintmain = document.getElementById( 'hint'+num ); var hint = document.getElementById('hint'+num).getElementsByTagName('ul')[0]; var toggleLink = document.getElementById( 'togglelink' );
if ( hint && toggleLink && hint.style.display == 'none' ) { changeText( toggleLink, hintHideText ); hint.style.display = 'block'; //document.cookie = "hidehint=0"; hintmain.className = 'hint'; } else { changeText( toggleLink, hintShowText ); hint.style.display = 'none'; //document.cookie = "hidehint=1"; hintmain.className = 'hint tochidden'; } }
Navigáció |
---|
[[{{{tárgynév}}}]]
[[Kategória:{{{témakör}}}]] |
Gyakorlatok listája: {{ Kategória:{{{tárgynév}}} }} |
[[{{{előző}}}|Előző gyakorlat]] [[{{{következő}}}|Következő gyakorlat]] |