搜索页优化

This commit is contained in:
gongfuxiang 2022-07-10 22:05:33 +08:00
parent 0279490915
commit 1d84dccaa0
3 changed files with 64 additions and 6 deletions

View File

@ -154,6 +154,10 @@
</li>
{{/foreach}}
</ul>
<div class="map-more-submit am-hide">
<span>更多</span>
<i class="am-icon-angle-down"></i>
</div>
</div>
{{/if}}
</li>
@ -171,6 +175,10 @@
</li>
{{/foreach}}
</ul>
<div class="map-more-submit am-hide">
<span>更多</span>
<i class="am-icon-angle-down"></i>
</div>
</div>
</li>
{{/if}}
@ -187,6 +195,10 @@
</li>
{{/foreach}}
</ul>
<div class="map-more-submit am-hide">
<span>更多</span>
<i class="am-icon-angle-down"></i>
</div>
</div>
</li>
{{/if}}
@ -203,6 +215,10 @@
</li>
{{/foreach}}
</ul>
<div class="map-more-submit am-hide">
<span>更多</span>
<i class="am-icon-angle-down"></i>
</div>
</div>
</li>
{{/if}}
@ -219,6 +235,10 @@
</li>
{{/foreach}}
</ul>
<div class="map-more-submit am-hide">
<span>更多</span>
<i class="am-icon-angle-down"></i>
</div>
</div>
</li>
{{/if}}

View File

@ -35,9 +35,15 @@
background-color: transparent !important;
}
.map-images-text-items ul,
.map-text-items ul {
padding: 10px 0 0 10px;
.map-text-items {
height: 45px;
}
.map-images-text-items {
height: 55px;
}
.map-images-text-items,
.map-text-items {
padding: 10px 48px 0 10px;
overflow-y: hidden;
}
.map-images-text-items ul > li {
@ -105,6 +111,15 @@
padding: 0;
color: #333;
}
.map-item .map-more-submit {
position: absolute;
top: 15px;
right: 10px;
height: 20px;
line-height: 20px;
color: #999;
cursor: pointer;
}
@media only screen and (min-width: 640px) {
.map-images-text-items ul > li > a:hover,
.map-text-items ul > li > a:hover {
@ -166,9 +181,6 @@
.map-item > li > a:first-child {
border-bottom: 2px solid #e1e1e1;
}
.map-images-text-items ul, .map-text-items ul {
padding: 15px 15px 0 15px;
}
.map-item .map-more-submit {
top: 7px;
}

View File

@ -0,0 +1,26 @@
$(function()
{
// 条件展开关闭处理
$('.map-images-text-items,.map-text-items').each(function(k, v)
{
var height = $(this).find('ul').innerHeight();
var max_height = $(this).hasClass('map-images-text-items') ? 55 : 45;
if(height > max_height || $(window).width() < 641)
{
$(this).find('.map-more-submit').removeClass('am-hide');
}
});
// 条件展开/隐藏
$('.map-item .map-more-submit').on('click', function()
{
var $parents = $(this).parents('.map-right');
var height = $parents.hasClass('map-images-text-items') ? '55px' : '45px';
if($parents.css('height') == height)
{
$parents.css('height', 'auto');
} else {
$parents.css('height', height);
}
});
});