Ero sivun ”Widget:JwAccordion” versioiden välillä
Järvi-meriwikistä
(Ak: Uusi sivu: <includeonly> <script type="text/javascript"> (function() { // globals var today = new Date(); function <!--{$id|default:TheAccordion|escape:'html'}-->_jQueryTest(...) |
|||
(4 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 17: | Rivi 17: | ||
setTimeout( function(){ <!--{$id|default:TheAccordion|escape:'html'}-->_jQueryTest() }, 300); | setTimeout( function(){ <!--{$id|default:TheAccordion|escape:'html'}-->_jQueryTest() }, 300); | ||
− | function <!--{$id|default:TheAccordion|escape:'html'}-->_func() { | + | function <!--{$id|default:TheAccordion|escape:'html'}-->_func() { |
− | if ( typeof | + | if ( typeof jQuery.ui == 'undefined' ) { |
− | window.jwObsChart = true; | + | //window.jwObsChart = true; |
css_link = jQuery( "<link>", { rel: "stylesheet", type: "text/css", href: "//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css" }); | css_link = jQuery( "<link>", { rel: "stylesheet", type: "text/css", href: "//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css" }); | ||
css_link.appendTo('head'); | css_link.appendTo('head'); | ||
− | jQuery.getScript( "https://code.jquery.com/ui/1.13.2/jquery-ui. | + | jQuery.getScript( "https://code.jquery.com/ui/1.13.2/jquery-ui.js", function() { |
allReady(); | allReady(); | ||
}); | }); | ||
+ | } else { | ||
+ | allReady(); | ||
} | } | ||
} | } | ||
Rivi 30: | Rivi 32: | ||
function allReady() { | function allReady() { | ||
− | jQuery( '.jwAccordion' ).each() { | + | jQuery( '.jwAccordion' ).each( function() { |
− | jQuery( this ).accordion(); | + | jQuery( this ).accordion({ |
+ | collapsible: true, | ||
+ | heightStyle: "content", | ||
+ | autoHeight: false, | ||
+ | clearStyle: true, | ||
+ | }); | ||
}); | }); |