首页 | 3118 | 114 | 1135 | 添加收藏 上一个 下一个
移动端分类双向联动列表锚点定位

功能描述


商品分类,分类布局


依赖的模块


不需要依赖,引入即可使用


快速使用


更多布局请查看原文件,左边导航ul>li对应右边商品ul>li作为锚点


<div class="sort_container" id="sort_container">
    <!--左边导航-->
    <div class="sort_navbar">
        <ul>
            <li class="on">分类1</li>
            <li>分类2</li>
        </ul>
    </div>
    <!--右边商品-->
    <div class="sort_wrap">
        <ul>
            <li>
                /*标题*/
                <div class="title">分类1</div>
                <div class="product">
                    <div class="product_box">
                        /*商品图片*/
                        <img src="image/img_1.png"> /*商品名称*/
                        <span>手机</span>
                    </div>
                    <div class="product_box">
                        /*商品图片*/
                        <img src="image/img_2.png"> /*商品名称*/
                        <span>手机</span>
                    </div>
                </div>
            </li>
            <li>
                /*标题*/
                <div class="title">分类1</div>
                <div class="product">
                    <div class="product_box">
                        /*商品图片*/
                        <img src="image/img_1.png"> /*商品名称*/
                        <span>手机</span>
                    </div>
                    <div class="product_box">
                        /*商品图片*/
                        <img src="image/img_2.png"> /*商品名称*/
                        <span>手机</span>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</div>
//初始化代码 window.onload = function () { isCategory.init(); }

特别说明


由于差异问题,导航点击android会有平滑动画,ios是直接定位在锚点