add showOrHideSlider method

This commit is contained in:
tangjiang 2019-12-11 11:54:31 +08:00
parent 4c6c9b1835
commit 57bab84fb1
1 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-11 09:17:17 * @Date: 2019-12-11 09:17:17
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-11 11:50:01 * @LastEditTime: 2019-12-11 11:53:57
*/ */
$(document).ready(function () { $(document).ready(function () {
$('#btn').on('click', function () { $('#btn').on('click', function () {
@ -39,8 +39,8 @@ $(document).ready(function () {
}); });
}); });
// 收缩左侧侧边栏 // 点击地图时,调用此方法
$('.collpase-icon').on('click', function() { function showOrHideSlider () {
if ($('.fixed-left').hasClass('collpased')) { if ($('.fixed-left').hasClass('collpased')) {
$('.fixed-left').removeClass('collpased'); $('.fixed-left').removeClass('collpased');
$('.map_header').css({left: 0}); $('.map_header').css({left: 0});
@ -57,6 +57,10 @@ $(document).ready(function () {
} else { } else {
$(this).removeClass('icon-shouqi').addClass('icon-zhankai') $(this).removeClass('icon-shouqi').addClass('icon-zhankai')
} }
}
// 收缩左侧侧边栏
$('.collpase-icon').on('click', function() {
showOrHideSlider();
// $(this).hasClass('icon-zhankai') // $(this).hasClass('icon-zhankai')
// ? $(this).removeClass('icon-zhankai').addClass('icon-shouqi') // ? $(this).removeClass('icon-zhankai').addClass('icon-shouqi')
// : $(this).removeClass('icon-shouqi').addClass('icon-zhankai) // : $(this).removeClass('icon-shouqi').addClass('icon-zhankai)