跳至主要内容

[CSS] Foundation JavaScript Utilities

keywords: foundation, css, javascript
/**
* Box
**/
Foundation.Box.GetDimensions(element);
Foundation.Box.ImNotTouchingYou(element [, parent, leftAndRightOnly, topAndBottomOnly]);


/**
* Keyboard
**/
Foundation.Keyboard.findFocusable($('#content'));
Foundation.Keyboard.trapFocus($('#content'));
Foundation.Keyboard.releaseFocus($('#content'));

/**
* MediaQuery
**/

Foundation.MediaQuery.get('medium');
Foundation.MediaQuery.atLeast('large');
Foundation.MediaQuery.queries;
Foundation.MediaQuery.current;

$(window).on('changed.zf.mediaquery', function(event, newSize, oldSize){});

/**
* Timer: includes: timer.start(), timer.pause(), timer.restart()
**/
var timer = new Foundation.Timer($element, {duration: ms, infinite: bool}, callback);


/**
* ImageLoader
**/
Foundation.onImagesLoaded($images, callback);

/**
* Touch
**/
$('selector').addTouch().on('mousemove', handleDrag);
$('selector').spotSwipe().on('swipeleft', handleLeftSwipe);

參考資料