Coder Social home page Coder Social logo

hselect's Introduction

这个JS文件是对select标签的一个扩展,使得select能够支持树形下拉框

1.依赖关系:

使用这段js代码之前,请先引入jQuery库。

2.使用示例代码:

	$.getJSON("/api/data/jsonType",function(data){

		var arr = new Array();

	    $(data).each(function(index,element){

	        var ijs = {};

	        ijs.id = element.Busiz_id

	        ijs.text = element.Busiz_desc

	        ijs.upId = element.Busiz_up_id

	        arr.push(ijs)

	          
	    });

	    $("#SelectId").Hselect({

	        data:arr,

	        height:"29px",

	        border:"#ccc solid 1px",

	    });

	}

3.可供修改的参数:

    #待显示数据
	data: "",

	#提示框高度
    height:"26px",

    #提示框宽度
    width:"auto",

    #提示框边框属性
    border:"#000 solid 1px",

    #提示框字体大小
    fontSize:"13px",
    
    #提示框圆角大小
    borderRadius:"5px",

    #提示框背景色
    bgColor:"white",
            

    #下边这个参数,是树形下拉框中每一个选项的高度
    showLiHeight:"30px",

    #下边这个参数,是树形下拉框的最大高度
    showHeight:"230px",

    #下边这个参数,是树形下拉框中,边框属性,默认情况下与上边border变量值一致
    showBorder:"",

    #下边这个参数,是树形下拉框中,字体大小
    showFontSize:"14px",

    #下边这个参数,是树形下拉框中,隐藏或展示图标的颜色。
    iconColor:"#ff5763",

	#当下拉框有选项被选中时触发的函数.请传入一个function,否则无意义.
    onChange:"",

hselect's People

Contributors

hzwy23 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.