• [原创]HTML 用div模拟select下拉框


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
    <SCRIPT type="text/javascript"  src="./jquery.js"></SCRIPT>
    <STYLE>
    * {
        PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px; PADDING-RIGHT: 0px
    }
    BODY {
        FONT-SIZE: 12px; PADDING-BOTTOM: 0px; TEXT-ALIGN: center; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px; PADDING-RIGHT: 0px
    }
    
    
    .theSelected B {
        OVERFLOW: hidden; BACKGROUND-IMAGE: url(http://static.nipic.com/img/searchNav_on_span.png); BACKGROUND-REPEAT: no-repeat
    }
    
    
    .theSelected {
        CURSOR: pointer; BORDER-TOP: #9ba8b0 1px solid; HEIGHT: 20px; BORDER-RIGHT: #9ba8b0 1px solid; BORDER-BOTTOM: #9ba8b0 1px solid; FLOAT: left; BORDER-LEFT: #9ba8b0 1px solid; LINE-HEIGHT: 20px; WIDTH: 79px
    }
    .theSelected SPAN {
        HEIGHT: 20px; FLOAT: left; COLOR: #000; PADDING-LEFT: 9px; WIDTH: 58px
    }
    .theSelected B {
        HEIGHT: 5px; BACKGROUND-POSITION: -120px -100px; FLOAT: left; MARGIN-TOP: 8px; WIDTH: 7px
    }
    .theSelected .toClose {
        BACKGROUND-POSITION: -120px -106px
    }
    
    .sortBtnDesc {
        OVERFLOW: hidden; BACKGROUND-IMAGE: url(http://static.nipic.com/img/searchNav_on_span.png); BACKGROUND-REPEAT: no-repeat
    }
    
    .sortBtnDesc {
        CURSOR: pointer; BORDER-TOP: #9ba8b0 1px solid; HEIGHT: 20px; BORDER-RIGHT: #9ba8b0 1px solid; BORDER-BOTTOM: #9ba8b0 1px solid; BACKGROUND-POSITION: -187px -99px; FLOAT: left; BORDER-LEFT: #9ba8b0 1px; WIDTH: 22px
    }
    
    .falseSelect {
        HEIGHT: 22px; FONT-FAMILY: simsun; BACKGROUND: url(http://static.nipic.com/img/falseSelect.png) repeat-x 0px 0px; POSITION: relative; FLOAT: left; MARGIN: 5px 9px 0px 0px; Z-INDEX: 51; WIDTH: 104px
    }
    
    .falseOption {
        BORDER-TOP: #a5b1b8 1px; HEIGHT: 144px; BORDER-RIGHT: #a5b1b8 1px solid; BORDER-BOTTOM: #a5b1b8 1px solid; POSITION: absolute; LEFT: 0px; BORDER-LEFT: #a5b1b8 1px solid; Z-INDEX: 51; DISPLAY: none; TOP: 22px; WIDTH: 79px; BACKGROUND-COLOR: #fff
    }
    
    .falseOption A {
        HEIGHT: 24px; COLOR: #333; PADDING-LEFT: 9px; TEXT-DECORATION: none; DISPLAY: block; LINE-HEIGHT: 24px
    }
    .falseOption A:hover {
        COLOR: #fff; BACKGROUND-COLOR: #1f3d99
    }
    </STYLE>
    </HEAD>
    <BODY>
    <div style="padding-left:100px">
    <DIV id=picRatio class=falseSelect>
        <DIV class=theSelected><SPAN>分辨率</SPAN><B class=ico></B></DIV><SPAN 
        title=分辨率由高到低 class=sortBtnDesc></SPAN>
        <DIV class=falseOption>
        <A id=300r href="">&gt;=300</A>
        <A id=180r  href="">&gt;=180</A>
        <A id=96r href="">&gt;=96</A>
        <A id=72r     href="">&gt;=72</A>
        <A id=72_300r     href="">72-300</A>
        <A id=nor     href="">不限</A>
        </DIV>
    </DIV>
    </div>
    
    <script>
    function theFalseSelect(){ 
    
    $(".theSelected").hover(function(){
    $(this).siblings(".falseOption").show();
    },
    function(){
    $(this).siblings(".falseOption").hide();
    });
    
    $(".falseOption").hover(function(){
    $(this).show();
    },function(){
    $(this).hide();
    });
    
    $(".falseOption a").bind("click",function(){
    $(this).closest(".falseOption").siblings(".theSelected").find("span").html($(this).html());
    $(this).closest(".falseOption").hide();})
    }
    theFalseSelect();
    </script>
    
    
    </BODY></HTML>
  • 相关阅读:
    Jmeter22:同步定时器-集合点功能
    Jmeter21:固定定时器-死等的方法
    Jmeter20:上传与下载
    Jmeter19:token接口
    Jmeter18:cookie接口-请求提示no cookie的解决方法
    Jmeter17:json提取器-提取数据的方法
    Jmeter16:forEach控制器-针对,在不知道取到得参数有多少?但是要全部执行每一条的情况
    Jmeter15:仅一次控制器-针对在每个并发用户都要调用一次的情况
    Jmeter14:随机顺序执行器-每个请求都执行,当是顺序打乱的情况
    Jmeter13:常用的逻辑控制器-if-随机-仅一次-switch...
  • 原文地址:https://www.cnblogs.com/yzryc/p/6963847.html
Copyright © 2020-2023  润新知