Quellcode durchsuchen

修复选项卡右侧滑动到视区bug

shuzheng vor 9 Jahren
Ursprung
Commit
283caaeb1c
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      zheng-cms/zheng-cms-web/src/main/webapp/resources/js/admin.js

+ 2 - 2
zheng-cms/zheng-cms-web/src/main/webapp/resources/js/admin.js

@@ -61,8 +61,8 @@ $(function() {
 			});
 			});
 		}
 		}
 		// 滚动到可视区域:在右侧
 		// 滚动到可视区域:在右侧
-		if(($('.content_tab>ul').scrollLeft() + document.getElementById('tabs').clientWidth) < ($(this).position().left + $(this).width())) {
-			var left = ($(this).position().left + $(this).width()) - document.getElementById('tabs').clientWidth;
+		if(($(this).position().left + $(this).width() - marginLeft) > document.getElementById('tabs').clientWidth) {
+			var left = $('.content_tab>ul').scrollLeft() + (($(this).position().left + $(this).width() - marginLeft) - document.getElementById('tabs').clientWidth);
 			$('.content_tab>ul').animate({scrollLeft: left}, 200, function() {
 			$('.content_tab>ul').animate({scrollLeft: left}, 200, function() {
 				initScrollState();
 				initScrollState();
 			});
 			});