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