EasyUI的accordion(手风琴)折叠面板

1 accordion效果

这里写图片描述

本篇主要是为了记录工作中使用该样式时遇到的各种问题及解决方法。

样式代码:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Multiple Accordion Panels - jQuery EasyUI Demo</title>
    <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../demo.css">
    <script type="text/javascript" src="../../jquery.min.js"></script>
    <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
    <h2>Multiple Accordion Panels</h2>
    <p>Enable 'multiple' mode to expand multiple panels at one time.</p>
    <div style="margin:20px 0 10px 0;"></div>
    <div class="easyui-accordion" data-options="multiple:true" style="width:500px;height1:300px;">
        <div title="Language" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
            <p>A programming language is a formal language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.</p>
        </div>
        <div title="Java" style="padding:10px;">
            <p>Java (Indonesian: Jawa) is an island of Indonesia. With a population of 135 million (excluding the 3.6 million on the island of Madura which is administered as part of the provinces of Java), Java is the world's most populous island, and one of the most densely populated places in the world.</p>
        </div>
        <div title="C#" style="padding:10px;">
            <p>C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.</p>
        </div>
        <div title="Ruby" style="padding:10px;">
            <p>A dynamic, reflective, general-purpose object-oriented programming language.</p>
        </div>
        <div title="Fortran" style="padding:10px;">
            <p>Fortran (previously FORTRAN) is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing.</p>
        </div>
    </div>
</body>
</html>

2 用到的属性及方法

2.1 在手风琴样式中嵌入其他页面文件

        //在子项div标签中添加属性
        //data-options="href:'xxx.html'"
    <div class="easyui-accordion" data-options="multiple:true" style="">
        <div title="1" style="overflow:auto;padding:10px;" data-options="href:'xxx.html'"></div>

        <div title="2" style="padding:10px;" data-options="href:'xxx.html'"></div>

    </div>

3 问题及解决方法

3.1 嵌入的html页面文件中head标签中的javascript和css无法加载

解决方法:将script和link标签放到页面文件的body标签中,且引用路径修改为以主html页面所在位置为准,不再是以引用的原html文件位置为参考位置。

3.2 嵌入多个页面后,正常的js文件运行出现错误

解决方法:查看多个js文件或html页面是否有命名相同的内容,如多个html页面中出现相同的id名,多个js文件中出现多个相同的变量名。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值