DataLazyload
Class
- DataLazyload ()
Attributes
- autoDestroy {Boolean} Whether destroy this component when all lazy loaded elements are loaded.
- containers {HTMLElement[]} Containers which will be monitor scroll event to lazy load elements within it.
- diff {Number|Object} Distance outside viewport or specified container to pre load.
- execScript {Boolean} Whether execute script in lazy loaded textarea.
- placeholder {String} Placeholder img url for lazy loaded _images.
Methods
- addCallback (el, fn) Register callback function.
- addElements (els) Add a array of imgs or textareas to be lazy loaded to monitor list.
- destroy () Destroy this component.Will fire destroy event.
- DataLazyload. loadCustomLazyData (containers, type, flag) <static> Load lazyload textarea and imgs manually.
- removeCallback (el, fn) Remove a callback function.
- removeElements (els) Remove a array of element from monitor list.
Attributes Detail
-
autoDestroy {Boolean} Whether destroy this component when all lazy loaded elements are loaded. Default : true
-
containers {HTMLElement[]} Containers which will be monitor scroll event to lazy load elements within it. Default : [ document ]
-
diff {Number|Object} Distance outside viewport or specified container to pre load. Default : pre load one screen height and width.
- Example
-
-
diff : 50 // pre load 50px outside viewport or specified container // or more detailed : { left:20, // pre load 50px outside left edge of viewport or specified container right:30, // pre load 50px outside right edge of viewport or specified container top:50, // pre load 50px outside top edge of viewport or specified container bottom:60 // pre load 50px outside bottom edge of viewport or specified container }
-
-
execScript {Boolean} Whether execute script in lazy loaded textarea. Default : true
-
placeholder {String} Placeholder img url for lazy loaded _images. Default : empty
Methods Detail
-
addCallback (el, fn) view sourceRegister callback function. When el is in viewport, then fn is called.
- Parameters
-
- el {HTMLElement|String} Html element to be monitored.
- fn {Function} Callback function to be called when el is in viewport.
-
addElements (els) view sourceAdd a array of imgs or textareas to be lazy loaded to monitor list.
- Parameters
-
- els {HTMLElement[]} Array of imgs or textareas to be lazy loaded
- Since
- 1.3
-
destroy () view sourceDestroy this component.Will fire destroy event.
-
Load lazyload textarea and imgs manually.
- Parameters
-
- containers {HTMLElement[]} Containers with in which lazy loaded elements are loaded.
- type {String} Type of lazy loaded element. "img" or "textarea"
- [ flag ] {String} flag which will be searched to find lazy loaded elements from containers. Default "data-ks-lazyload-custom" for img attribute and "ks-lazyload-custom" for textarea css class.
-
removeCallback (el, fn) view sourceRemove a callback function. See DataLazyload#addCallback
- Parameters
-
- el {HTMLElement|String} Html element to be monitored.
- [ fn ] {Function} Callback function to be called when el is in viewport. If not specified, remove all callbacks associated with el.
- Since
- 1.3
-
removeElements (els) view sourceRemove a array of element from monitor list. See DataLazyload#addElements.
- Parameters
-
- els {HTMLElement[]} Array of imgs or textareas to be lazy loaded
- Since
- 1.3
Classes
- Anim
- Anim.Easing
- Attribute
- Base
- Button
- ComboBox
- ComboBox.LocalDataSource
- ComboBox.RemoteDataSource
- Component
- Component.Container
- Component.Controller
- Component.Manager
- Component.Render
- Component.UIBase
- Component.UIBase.Align
- Component.UIBase.Box
- Component.UIBase.Close
- Component.UIBase.Constrain
- Component.UIBase.ContentBox
- Component.UIBase.Drag
- Component.UIBase.Loading
- Component.UIBase.Mask
- Component.UIBase.Position
- Component.UIBase.Resize
- Component.UIBase.StdMod
- Cookie
- DataLazyload
- DD
- DD.Constrain
- DD.DDM
- DD.Draggable
- DD.DraggableDelegate
- DD.Droppable
- DD.DroppableDelegate
- DD.Proxy
- DD.Scroll
- DOM
- Editor
- Editor.Range
- Editor.Utils
- Editor.Walker
- Event
- Event.Object
- Event.Target
- IO
- IO.XhrObject
- KISSY
- KISSY.Defer
- KISSY.Loader
- KISSY.Loader.Module
- KISSY.Loader.Package
- KISSY.Promise
- Menu
- Menu.FilterMenu
- Menu.Item
- Menu.PopupMenu
- Menu.Separator
- MenuButton
- MenuButton.Option
- MenuButton.Select
- MVC
- MVC.Collection
- MVC.Model
- MVC.Router
- MVC.View
- NodeList
- Overlay
- Overlay.Dialog
- Overlay.Popup
- Resizable
- Tree
- Tree.CheckNode
- Tree.CheckTree
- Tree.Node
- Waterfall
- Waterfall.Loader