109109 var opts = this . opts ( ) ;
110110 opts . API . trigger ( 'cycle-post-initialize' , [ opts ] ) ;
111111 var tx = $ . fn . cycle . transitions [ opts . fx ] ;
112- if ( tx && $ . isFunction ( tx . postInit ) )
112+ if ( tx && typeof tx . postInit === "function" )
113113 tx . postInit ( opts ) ;
114114 } ,
115115
206206 var len ;
207207
208208 if ( $ . type ( slides ) == 'string' )
209- slides = $ . trim ( slides ) ;
209+ slides = slides . trim ( ) ;
210210
211211 $ ( slides ) . each ( function ( i ) {
212212 var slideOpts ;
414414 }
415415 if ( opts . continueAuto !== undefined ) {
416416 if ( opts . continueAuto === false ||
417- ( $ . isFunction ( opts . continueAuto ) && opts . continueAuto ( ) === false ) ) {
417+ ( typeof opts . continueAuto === "function" && opts . continueAuto ( ) === false ) ) {
418418 opts . API . log ( 'terminating automatic transitions' ) ;
419419 opts . timeout = 0 ;
420420 if ( opts . timeoutId )
682682 } ;
683683
684684 // automatically find and run slideshows
685- $ ( document ) . ready ( function ( ) {
685+ jQuery ( function ( ) {
686686 $ ( $ . fn . cycle . defaults . autoSelector ) . cycle ( ) ;
687687 } ) ;
688688
700700
701701 $ ( document ) . on ( 'cycle-initialized' , function ( e , opts ) {
702702 var autoHeight = opts . autoHeight ;
703- var t = $ . type ( autoHeight ) ;
703+ var t = typeof autoHeight ;
704704 var resizeThrottle = null ;
705705 var ratio ;
706706
751751 else if ( opts . _autoHeightRatio ) {
752752 opts . container . height ( opts . container . width ( ) / opts . _autoHeightRatio ) ;
753753 }
754- else if ( autoHeight === 'calc' || ( $ . type ( autoHeight ) == 'number' && autoHeight >= 0 ) ) {
754+ else if ( autoHeight === 'calc' || ( typeof autoHeight = == 'number' && autoHeight >= 0 ) ) {
755755 if ( autoHeight === 'calc' )
756756 sentinelIndex = calcSentinelIndex ( e , opts ) ;
757757 else if ( autoHeight >= opts . slides . length )
890890 else {
891891 cmd = cmd == 'goto' ? 'jump' : cmd ; // issue #3; change 'goto' to 'jump' internally
892892 cmdFn = opts . API [ cmd ] ;
893- if ( $ . isFunction ( cmdFn ) ) {
893+ if ( typeof cmdFn === "function" ) {
894894 cmdArgs = $ . makeArray ( args ) ;
895895 cmdArgs . shift ( ) ;
896896 return cmdFn . apply ( opts . API , cmdArgs ) ;
939939 this . stop ( ) ; //#204
940940
941941 var opts = this . opts ( ) ;
942- var clean = $ . isFunction ( $ . _data ) ? $ . _data : $ . noop ; // hack for #184 and #201
942+ var clean = typeof $ . _data === "function" ? $ . _data : $ . noop ; // hack for #184 and #201
943943 clearTimeout ( opts . timeoutId ) ;
944944 opts . timeoutId = 0 ;
945945 opts . API . stop ( ) ;
11231123
11241124 function add ( slides , prepend ) {
11251125 var slideArr = [ ] ;
1126- if ( $ . type ( slides ) == 'string' )
1127- slides = $ . trim ( slides ) ;
1128- else if ( $ . type ( slides ) === 'array' ) {
1126+ if ( typeof slides = == 'string' )
1127+ slides = slides . trim ( ) ;
1128+ else if ( Array . isArray ( slides ) ) {
11291129 for ( var i = 0 ; i < slides . length ; i ++ )
11301130 slides [ i ] = $ ( slides [ i ] ) [ 0 ] ;
11311131 }
13891389 var nextFn = API . next ;
13901390 var prevFn = API . prev ;
13911391 var prepareTxFn = API . prepareTx ;
1392- var type = $ . type ( opts . progressive ) ;
1392+ var type = typeof opts . progressive ;
13931393 var slides , scriptEl ;
13941394
13951395 if ( type == 'array' ) {
13961396 slides = opts . progressive ;
13971397 }
1398- else if ( $ . isFunction ( opts . progressive ) ) {
1398+ else if ( typeof opts . progressive === "function" ) {
13991399 slides = opts . progressive ( opts ) ;
14001400 }
14011401 else if ( type == 'string' ) {
14021402 scriptEl = $ ( opts . progressive ) ;
1403- slides = $ . trim ( scriptEl . html ( ) ) ;
1403+ slides = scriptEl . html ( ) . trim ( ) ;
14041404 if ( ! slides )
14051405 return ;
14061406 // is it json array?
15341534 prop = obj [ str ] ;
15351535 }
15361536
1537- if ( $ . isFunction ( prop ) )
1537+ if ( typeof prop === "function" )
15381538 return prop . apply ( obj , args ) ;
15391539 if ( prop !== undefined && prop !== null && prop != str )
15401540 return prop ;
16161616 opts . busy = 1 ;
16171617 if ( opts . fxFn ) // fx function provided?
16181618 opts . fxFn ( curr , next , opts , after , fwd , manual && opts . fastOnEvent ) ;
1619- else if ( $ . isFunction ( $ . fn . cycle [ opts . fx ] ) ) // fx plugin ?
1619+ else if ( typeof $ . fn . cycle [ opts . fx ] === "function" ) // fx plugin ?
16201620 $ . fn . cycle [ opts . fx ] ( curr , next , opts , after , fwd , manual && opts . fastOnEvent ) ;
16211621 else
16221622 $ . fn . cycle . custom ( curr , next , opts , after , fwd , manual && opts . fastOnEvent ) ;
@@ -1741,7 +1741,7 @@ function advance(opts, moveForward) {
17411741 }
17421742
17431743 var cb = opts . onPrevNextEvent || opts . prevNextClick ; // prevNextClick is deprecated
1744- if ( $ . isFunction ( cb ) )
1744+ if ( typeof cb === "function" )
17451745 cb ( val > 0 , opts . nextSlide , els [ opts . nextSlide ] ) ;
17461746 go ( els , opts , 1 , moveForward ) ;
17471747 return false ;
@@ -1757,7 +1757,7 @@ function buildPager(els, opts) {
17571757
17581758$ . fn . cycle . createPagerAnchor = function ( i , el , $p , els , opts ) {
17591759 var a ;
1760- if ( $ . isFunction ( opts . pagerAnchorBuilder ) ) {
1760+ if ( typeof opts . pagerAnchorBuilder === "function" ) {
17611761 a = opts . pagerAnchorBuilder ( i , el ) ;
17621762 debug ( 'pagerAnchorBuilder(' + i + ', el) returned: ' + a ) ;
17631763 }
@@ -1795,7 +1795,7 @@ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
17951795 p . cycleTimeout = 0 ;
17961796 }
17971797 var cb = opts . onPagerEvent || opts . pagerClick ; // pagerClick is deprecated
1798- if ( $ . isFunction ( cb ) )
1798+ if ( typeof cb === "function" )
17991799 cb ( opts . nextSlide , els [ opts . nextSlide ] ) ;
18001800 go ( els , opts , 1 , opts . currSlide < i ) ; // trigger the trans
18011801// return false; // <== allow bubble
@@ -1931,7 +1931,7 @@ $.fn.cycle.defaults = {
19311931 backwards : false , // true to start slideshow at last slide and move backwards through the stack
19321932 before : null , // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag)
19331933 center : null , // set to true to have cycle add top/left margin to each slide (use with width and height options)
1934- cleartype : ! $ . support . opacity , // true if clearType corrections should be applied (for IE)
1934+ cleartype : ! ( typeof document . createElement ( 'div' ) . style . opacity !== 'undefined' ) , // true if clearType corrections should be applied (for IE)
19351935 cleartypeNoBg : false , // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
19361936 containerResize : 1 , // resize container to fit largest slide
19371937 containerResizeHeight : 0 , // resize containers height to fit the largest slide but leave the width dynamic
0 commit comments