JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<section class="item-list">
<div class="house-list">
<div class="house-list-detail clearfix">
<div class="list-left">
<img src="https://image.shutterstock.com/image-photo/alone-tree-autumn-park-600w-111192200.jpg" alt="房屋列表圖片">
<div class="house-list-Info">
<h3 id="house-list-title">楓葉</h3>
<span class="house-list-star">
<div id="star-bg">
<div id="star" style="width:80%"></div>
</div>
<p id="house-type">社區</p>
</span>
</div>
<div class="house-list-location">
<p id="house-location">桃園市龜山區111號</p>
</div>
<div class="house-list-score">
<b id="avg-score">4.5/5</b> <em>(共有200人評分)</em>
</div>
</div>
<b id="list-price">平均租價:5000元/月</b>
</div>
</div>
<div class="sl-box-tab" style="display: none;">
<ul role="tablist" class="tab-list">
<li role="tab" class="tab-item"><button class="tabs-label">房間</button></li>
<li role="tab" class="tab-item"><button class="tabs-label">位置</button></li>
<li role="tab" class="tab-item"><button class="tabs-label">評分</button></li>
</ul>
<div id="topright">Χ</div>
</div>
<article class="sl-box-list" id="sl-box-list">
<header class="sl-box-header text-overflow">
<h3 class="sl-title">房屋列表</h3>
</header>
<a href="">
<div class="sl-house-list ">
<div class="sl-house-left ">
<img src="https://image.shutterstock.com/image-photo/alone-tree-autumn-park-600w-111192200.jpg" alt="列表圖片">
<h3 id="sl-box-name">7777</h3>
<p id="sl-box-address"> 7777</p>
<p id="sl-box-type">獨立套房,2樓</p>
<b id="sl-box-score">4/5</b> <em>(共有20人評分)</em>
</div>
<div class="sl-house-right">
<em id="sq">坪數:13.5坪</em>
<h3 id="sl-box-price">租金:9000元/月</h3>
</div>
</div>
</a>
</article>
<article class="sl-box-rating rating-overall" id="sl-box-ratting">
<header class="sl-box-header text-overflow">
<h3 class="sl-title">評分總覽</h3>
</header>
<div class="clearfix">
<div class="sl-rating-score">
<h3 class="sl-box-score">平均評價:<span>4.5</span></h3>
</div>
<div class="rat-detail">
<div class="rat-chart">
<div class="rat-chart-group">
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">安寧程度</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">交通</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">整潔</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">安全</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
</div>
<div class="rat-chart-group-2">
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
</div>
</div>
<input type="button" class="link" id="link" value="+檢視更多" onclick="change();" />
</div>
</div>
</article>
<div class="sl-box-map" id="sl-box-map">
<header class="sl-box-header text-overflow">
<h3 class="sl-title">房屋位置</h3>
</header>
<div class="clearfix">
<div id="map"></div>
</div>
</div>
</section>
<section class="item-list">
<div class="house-list">
<div class="house-list-detail clearfix">
<div class="list-left">
<img src="https://image.shutterstock.com/image-photo/alone-tree-autumn-park-600w-111192200.jpg" alt="房屋列表圖片">
<div class="house-list-Info">
<h3 id="house-list-title">楓葉</h3>
<span class="house-list-star">
<div id="star-bg">
<div id="star" style="width:80%"></div>
</div>
<p id="house-type">社區</p>
</span>
</div>
<div class="house-list-location">
<p id="house-location">桃園市龜山區111號</p>
</div>
<div class="house-list-score">
<b id="avg-score">4.5/5</b> <em>(共有200人評分)</em>
</div>
</div>
<b id="list-price">平均租價:5000元/月</b>
</div>
</div>
<div class="sl-box-tab" style="display: none;">
<ul role="tablist" class="tab-list">
<li role="tab" class="tab-item"><button class="tabs-label">房間</button></li>
<li role="tab" class="tab-item"><button class="tabs-label">位置</button></li>
<li role="tab" class="tab-item"><button class="tabs-label">評分</button></li>
</ul>
<div id="topright">Χ</div>
</div>
<article class="sl-box-list" id="sl-box-list">
<header class="sl-box-header text-overflow">
<h3 class="sl-title">房屋列表</h3>
</header>
<a href="">
<div class="sl-house-list ">
<div class="sl-house-left ">
<img src="https://image.shutterstock.com/image-photo/alone-tree-autumn-park-600w-111192200.jpg" alt="列表圖片">
<h3 id="sl-box-name">7777</h3>
<p id="sl-box-address"> 7777</p>
<p id="sl-box-type">獨立套房,2樓</p>
<b id="sl-box-score">4/5</b> <em>(共有20人評分)</em>
</div>
<div class="sl-house-right">
<em id="sq">坪數:13.5坪</em>
<h3 id="sl-box-price">租金:9000元/月</h3>
</div>
</div>
</a>
</article>
<article class="sl-box-rating rating-overall" id="sl-box-ratting">
<header class="sl-box-header text-overflow">
<h3 class="sl-title">評分總覽</h3>
</header>
<div class="clearfix">
<div class="sl-rating-score">
<h3 class="sl-box-score">平均評價:<span>4.5</span></h3>
</div>
<div class="rat-detail">
<div class="rat-chart">
<div class="rat-chart-group">
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">安寧程度</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">交通</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">整潔</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">安全</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
</div>
<div class="rat-chart-group-2">
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
<div class="rat-chart-item">
<span class="rat-chart-label col-sm-5">位置</span>
<span class="rat-chart-bar">
<span class="rat-chart__bar-holder ">
<span class="rat-chart-bar-content rat-color-5" style="width: 87%;">
</span>
</span>
<span class="rat-chart-number"><span class="rat-chart-score-string">超級讚</span><span class="parentesis-wrapper">9.0 / 10</span></span>
</span>
</div>
</div>
</div>
<input type="button" class="link" id="link" value="+檢視更多" onclick="change();" />
</div>
</div>
</article>
<div class="sl-box-map" id="sl-box-map">
<header class="sl-box-header text-overflow">
<h3 class="sl-title">房屋位置</h3>
</header>
<div class="clearfix">
<div id="map"></div>
</div>
</div>
</section>
* {
padding: 0;
margin: 0;
}
* {
box-sizing: border-box;
}
body {
position: relative;
font-size: 14px;
color: #222222;
background: rgb(235, 236, 237);
font-family: 'Poppins', sans-serif;
max-width: 1920px;
margin: 0 auto;
overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
color: #222222;
text-transform: capitalize;
}
p {
line-height: 60px;
margin: 0;
color: #666666;
font-size: 16px;
}
ul {
padding: 0;
margin: 0;
list-style: none;
}
ul li {
list-style: none;
}
select,
input,
textarea,
button {
box-shadow: none;
outline: 0 !important;
}
html,
body {
height: 100%;
z-index: 2;
}
/*----------------------
item-list
----------------------*/
.item-list {
background-color: white;
position: relative;
max-width: 1000px;
width: 90%;
height: auto;
margin: 0 auto;
margin-bottom: 30px;
}
.list-left {
float: left;
max-width: 1000px;
width: 50%;
}
.house-list p {
font-family: monospace;
font-size: 2rem;
}
.clearfix {
overflow: auto;
zoom: 1;
}
#house-list-title {
position: relative;
cursor: pointer;
font-size: 2.5rem;
color: rgb(2, 97, 131);
}
.house-list img {
float: left;
position: relative;
margin-right: 1rem;
max-width: 200px;
height: 200px;
}
#star-bg {
float: left;
width: 80px;
height: 16px;
background: url("/assets/i-con/star-16.png");
margin-top: 20px;
}
#star {
float: left;
height: 16px;
background: url("/assets/i-con/star-2-16.png")
}
#house-type {
position: relative;
display: inline;
margin-left: 10px;
}
.house-list-location {
border: 1px solid rgb(235, 236, 237);
}
.house-list-location :hover {
cursor: pointer;
background-color: rgb(235, 236, 237);
}
.house-list-score {
border: 1px solid rgb(235, 236, 237);
cursor: pointer;
padding: 15px 10px 15px 10px
}
.house-list-score:hover {
cursor: pointer;
background-color: rgb(235, 236, 237);
}
#list-price {
float: right;
font-size: 20px;
color: red;
padding: 40px;
}
/*---------------------------*/
.sl-house-list:hover {
background-color: beige;
}
.sl-box-list{
display: none;
}
.sl-house-list{
text-decoration: none;
}
.sl-house-left {
float: left;
max-width: 1000px;
width: 50%;
}
.sl-house-left img {
float: left;
margin-right: 1rem;
width: 200px;
height: auto;
}
#sl-box-name {
font-size: 2.5rem;
color: rgb(2, 97, 131);
}
.sl-house-right {
display: flex;
}
#sq {
padding: 60px 30px 60px 0px;
font-size: 30px;
}
#sl-box-price {
padding: 70px 0px 70px 0px;
color: red;
font-size: 30px;
}
.sl-box-list a{
text-decoration: none;
}
#line {
height: 10px;
background: rgb(235, 236, 237);
}
/*---------------------------------*/
.sl-box-tab {
display: flex;
background-color: white;
overflow: hidden;
border: 1px solid #ccc;
width: 100%;
position: relative;
max-width: 1200px;
width: 100%;
height: auto;
margin: 0 auto;
}
.tab-list {
display: flex;
flex-direction: row;
margin: auto;
}
.tab-item {
font-size: 1.7rem;
}
.tabs-label {
background-color: #fff;
border: none;
color: black;
padding: 10px 10px 10px 10px;
text-align: center;
text-decoration: none;
}
.tabs-label:hover {
content: "";
background-color: #D3D3D3;
}
.tabs-label:active {
content: "";
color: blue;
border-bottom: 3px solid aqua;
}
#topright {
float: right;
cursor: pointer;
font-size: 28px;
padding: 0px 10px 0px 10px;
z-index: 1;
}
#topright:hover {
background-color: #D3D3D3;
}
.sl-title {
background-color: white;
padding: 5px 5px 5px 5px;
border: 1px solid #ccc;
position: relative;
height: auto;
margin: 0 auto;
}
.sl-rating-score {
margin: 5px 5px 5px 5px;
background-color: white;
border: 1px solid #ccc;
float: left;
max-width: 1000px;
width: 30%;
height: 200px;
}
.sl-box-score {
margin: 5px;
}
.rat-detail {
margin: 5px 5px 5px 5px;
background-color: white;
border: 1px solid #ccc;
float: right;
max-width: 1000px;
height: auto;
width: 65%;
}
.rat-chart {
display: table;
width: 100%;
border-spacing: 0 20px;
margin-top: -16px;
}
.rat-chart__bar-holder {
display: inline-block;
overflow: hidden;
height: 8px;
margin-top: 0;
border-radius: 2px;
background-color: #ebeced;
width: 40%;
}
.rat-chart-bar-content {
display: block;
height: 100%;
}
.rat-chart-score-string {
padding-left: 5px;
}
.rat-color-5 {
background-color: forestgreen;
}
.rat-chart-number {
display: inline-block;
}
.rat-chart-item {
line-height: 30px;
}
.rat-detail .link {
border: none;
color: cornflowerblue;
background-color: white;
padding: 0px 5px 0px 5px;
cursor: pointer;
outline-width: 0;
}
.rat-chart-group-2 {
display: none;
}
#map {
width: 95%;
height: 500px;
margin: 10px auto;
overflow: hidden;
}
#sl-box-ratting {
display: none;
margin: 10px;
}
.sl-box-map {
display: none;
}
$(".house-list-score").click(function () {
$(".sl-box-tab").show();
$("#sl-box-ratting").show();
$("#sl-box-map").hide();
$(".sl-box-list").hide();
});
$("#link").click(function () {
$(".rat-chart-group-2").toggle();
});
$("#house-location").click(function () {
$(".sl-box-tab").show();
$("#sl-box-map").show();
$("#sl-box-ratting").hide();
$(".sl-box-list").hide();
});
$("#topright").click(function () {
$(".sl-box-tab").hide();
$("#sl-box-map").hide();
$("#sl-box-ratting").hide();
$(".sl-box-list").hide();
});
$("#house-list-title").click(function () {
$(".sl-box-tab").show();
$(".sl-box-list").show();
$("#sl-box-map").hide();
$("#sl-box-ratting").hide();
});
function change() {
var btnVal = document.getElementById("link");
if (btnVal.value == "+檢視更多") {
btnVal.value = "-縮短檢視";
} else
btnVal.value = "+檢視更多";
}
Also see: Tab Triggers