(Ak: Uusi sivu: includeonly><script type="text/javascript"> function <!--{$id|default:JwAlternate|escape:'html'}-->_jQueryTest() { if ( typeof window.jQuery == 'undefined' ) { set...) |
Ei muokkausyhteenvetoa |
||
| (24 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
| Rivi 1: | Rivi 1: | ||
includeonly><script type="text/javascript"> | <includeonly><script type="text/javascript"> | ||
function <!--{$id|default:JwAlternate|escape:'html'}-->_jQueryTest() { | function <!--{$id|default:JwAlternate|escape:'html'}-->_jQueryTest() { | ||
| Rivi 5: | Rivi 5: | ||
setTimeout( function(){ <!--{$id|default:JwAlternate|escape:'html'}-->_jQueryTest() }, 300); | setTimeout( function(){ <!--{$id|default:JwAlternate|escape:'html'}-->_jQueryTest() }, 300); | ||
} else { | } else { | ||
<!--{$id|default:JwAlternate|escape:'html'}-->_func() | <!--{$id|default:JwAlternate|escape:'html'}-->_func(); | ||
} | } | ||
} | } | ||
| Rivi 15: | Rivi 15: | ||
jQuery( '.jwAlternate' ).hide(); | jQuery( '.jwAlternate' ).hide(); | ||
jQuery( '. | var items = jQuery( '.jwAlternate' ).length; | ||
//jQuery( '.jwAlternate_container' ).append( '<div class="jwAlternate_nav"></div>' ); | |||
//jQuery( '.jwAlternate_nav' ).append( '<button class="jwAlternate_nav"></div>' ); | |||
var items | |||
var cur = Math.floor( Math.random()*items + 1 ); | |||
jQuery( '.jwAlternate_' + cur.toString() ).show(); | |||
var change = function() { | var change = function() { | ||
jQuery( '.jwAlternate_' + cur.toString() ).hide(); | jQuery( '.jwAlternate_' + cur.toString() ).fadeOut( 300, function() { | ||
jQuery( '.jwAlternate' ).hide(); | |||
if ( cur == items ) { cur = 1; } else { cur++; } | |||
jQuery( '.jwAlternate_' + cur.toString() ).fadeIn( 300 ); | |||
}); | |||
} | } | ||
setInterval( change, timer ); | //setInterval( change, timer ); | ||
} | } | ||
</script></includeonly> | |||


