Ero sivun ”Widget:ShowHide” versioiden välillä
Järvi-meriwikistä
Rivi 1: | Rivi 1: | ||
− | + | <includeonly> | |
− | |||
− | |||
<div id="<!--{$id|escape:'quotes'}-->_buttonX" class="ShowHide-button"></div> | <div id="<!--{$id|escape:'quotes'}-->_buttonX" class="ShowHide-button"></div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
− | function <!--{$id|escape:'quotes'}--> | + | function <!--{$id|escape:'quotes'}-->_func() { |
if (!jQuery('#<!--{$id|escape:'quotes'}-->_button').length) { | if (!jQuery('#<!--{$id|escape:'quotes'}-->_button').length) { | ||
jQuery('#<!--{$id|escape:'quotes'}-->_buttonX').attr('class', 'ShowHide-button'); | jQuery('#<!--{$id|escape:'quotes'}-->_buttonX').attr('class', 'ShowHide-button'); | ||
Rivi 35: | Rivi 33: | ||
} | } | ||
− | |||
− | < | + | function <!--{$id|default:showHide|escape:'html'}-->_jQueryTest() { |
− | + | if ( typeof window.jQuery == 'undefined' ) { | |
+ | setTimeout( function(){ <!--{$id|default:showHide|escape:'html'}-->_jQueryTest() }, 300); | ||
+ | } else { | ||
+ | <!--{$id|default:showHide|escape:'html'}-->_func(); | ||
+ | } | ||
+ | } | ||
+ | setTimeout( function(){ <!--{$id|default:showHide|escape:'html'}-->_jQueryTest() }, 300); | ||
+ | |||
+ | |||
</script> | </script> | ||
</includeonly> | </includeonly> |