简体   繁体   中英

How to add a button ("X") - close window, close operation?

How to add a button ("X") - close window, close operation to this slider? This button has view look like ('X'). Please suggest me a way to improve this code.

</script>
<body>
<div id="main">
    <button class="left" onclick="slider.left();"><</button>
    <div id="scr"></div>
    <button class="right" onclick="slider.right();">></button>
</div>  
</body>
</html>

I don't know do you mean something like this

HTML

<body>
<div id="main">
    <button class="left" onclick="slider.left();"><</button>
    <div id="scr"></div>
    <button class="right" onclick="slider.right();">></button>
    <button class="close" onclick="slider.close();">X</button>
</div>  
</body>

CSS

#main {
    position: relative;
    height: 200px;
}

.left, .right, .close {
    position: absolute;
    top: 50%;
}

.right {
    right: 0;
}

.close {
    top: 15px;
    right: 0;
}

Here is fiddle http://jsfiddle.net/w58vxuft/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM