軸動效果插件,類似Github404頁面

軸動效果 axial3d

3D效果頁插件,類似 Github404 頁面動畫。

安裝引入 Install

npm install axial3d

or

<script src="https://unpkg.com/axial3d"></script>

例子 Example

Demo

<html>
<head>
    <title>Demo - Axial3d</title>
</head>
<body>
    <script src="https://unpkg.com/axial3d"></script>
    <div id="axial3d"></div>
    <script>
        (function () {
            var options = {
                selector: '#axial3d',
                imgs: [
                    {src: 'https://bestvist.github.io/axial3d/public/demo1/bg.png', left: '50px', top: '10px'},
                    {src: 'https://bestvist.github.io/axial3d/public/demo1/2.png', left: '150px', top: '10px'},
                    {src: 'https://bestvist.github.io/axial3d/public/demo1/3.png', left: '50px', top: '300px'},
                    {src: 'https://bestvist.github.io/axial3d/public/demo1/4.png', left: '300px', top: '300px'}
                ]
            }
            var effect = new Axial3d(options);
        })()
    </script>
</body>
</html>

屬性 Props

options

屬性 說明 類型 可選值 默認值
selector 元素選擇器 String - -
imgs 圖片組 Array - -
transform 動畫形式 String translate / rotate translate
swing 動畫幅度 Number - 5

imgs options

屬性 說明 類型 可選值 默認值
src 圖像路徑 String - -
top 圖片頂部定位 String - -
bottom 圖片底部定位 String - -
left 圖片左側定位 String - -
right 圖片右側定位 String - -
static 圖片是否靜態,不隨鼠標轉動 Boolean true / false false

方法 Methods

事件名稱 說明 回調參數
destory 取消事件監聽 -

項目地址
喜歡的歡迎star👏👏

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章