$(function () {

    $(".nav").ready(function () {
        jQuery(".nav").slide({
            type: "menu", // 效果类型，针对菜单/导航而引入的参数（默认slide）
            titCell: ".el", //鼠标触发对象
            targetCell: ".subnav", //titCell里面包含的要显示/消失的对象
            effect: "slideDown", //targetCell下拉效果
            delayTime: 300, //效果时间
            triggerTime: 0, //鼠标延迟触发时间（默认150）
            defaultPlay: true,
            returnDefault: true //鼠标移走后返回默认状态，例如默认频道是“预告片”，鼠标移走后会返回“预告片”（默认false）
        });
    })

    // 友情链接
    $(".lk2").ready(function () {
        $("#wx").on('mouseenter', function () {
            layer.tips('<img class="code2" src="' + $(this).attr('data-img') + '"/>', $(this), {
                tips: [3, '#d44c4f'],
                area: ['100px'],
                time: 0
            })
        });
        $("#wx").on("mouseleave", function () {
            layer.close(layer.index)
        });
    })

    $(".f-1-4 .lk-c  ").ready(function () {
        $(".f-1-4 .lk").hover(function () {
            $(".f-1-4 .lk-c").slideToggle(300);
            $(".lkbtn").toggleClass("on");
        })
    })
    // 幻灯
    $(".ban").ready(function () {
        jQuery(".ban").slide({
            mainCell: '.bd ul',
            titCell: '.hd ul',
            interTime: '6000',
            delayTime: '2300',
            autoPage: '<li></li>',
            autoPlay: true
        })
    })

    $(".m-1").ready(function () {
        /* 图片滚动效果 */
        $(".m-1").slide({
            titCell: ".hd a",
            mainCell: ".bd",
            effect: "fold"
        });


    });
    $(".m-3").ready(function () {
        jQuery(".m-3").slide({
            mainCell: '.bd ul',
            prevCell: '.prev',
            nextCell: '.next',
            effect: 'left',
            vis: 4,
            autoPage: true,
            autoPlay: true,
            interTime: 4000

        })
    })


    $("#schbtn1").on('click', function () {
        if ($("#keywords1").val() == '') {
            layer.msg("请输入搜索关键字");
            $("#keywords1").focus();
            return false;
        }
        $("#schform1").submit();
    })
    $("#schbtn2").on('click', function () {
        if ($("#keywords2").val() == '') {
            layer.msg("请输入搜索关键字");
            $("#keywords2").focus();
            return false;
        }
        $("#schform2").submit();
    })
    $("#schbtn").on('click', function () {
        if ($("#keywords").val() == '') {
            layer.msg("请输入搜索关键字");
            $("#keywords").focus();
            return false;
        }
        $("#schform").submit();
    })

})