반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Maven
- FCM
- MariaDB
- popup
- mysql
- git
- docker
- Java
- centos7
- node.js
- javascript
- Push
- security
- MSsql
- spring3
- mybatis
- ajax
- PM2
- rocky9
- jquery
- yona
- jenkins
- Next.js
- NextJS
- nodejs
- pwa
- Eclipse
- config
- SpringBoot
- Tomcat
Archives
- Today
- Total
ふたりで
URL location.pathname으로 구분 처리를 해야 할 경우... 본문
728x90
반응형
SMALL
나의 경우 특정 화면에서만 플로팅 메뉴의 위치를 조정해 줘야 하는 부분이 있었다.
아래와 같이 location.pathname으로 URL 경로를 구분하여 대시보드 화면에서만 플로팅 메뉴의 위치를 다르게
표시되도록 처리를 하였다.
//fixgroup컨트롤 dashBoard에서만 class fixgroup--top을 추가해준다
var pathname = window.location.pathname.split('/');
var lastindex = pathname.length;
var lastpath = pathname[lastindex-1];
console.log(lastpath);
if(lastpath == 'dashBoard'){
$('#fixgroup').addClass("fixgroup--top");
}
fixgroup--top 은 플로팅 메뉴를 아래로 58rem 내려가도록 설정했다.
- 플로팅 메뉴에 적용된 css
/* 화면고정 버튼그룹 */
.fixgroup {
position: absolute;
left: 50%;
margin-left: 55rem;
top: 17rem;
bottom: 0;
z-index: 10;
}
.fixgroup--top {
top: 58rem;
}
728x90
반응형
LIST
'javascript' 카테고리의 다른 글
개발자 도구 차단 1, Detect browser developer tools by javascript 1 (chrome, firefox, Edge) (0) | 2022.10.06 |
---|---|
window.location.href를 이용한 Query String get(),set() (0) | 2022.09.27 |
html 특정 영역 window.print 시 마지막 공백 페이지 제거 하기 (0) | 2022.09.16 |
HTML form의 onsubmit을 이용한 조건부 submit (2) | 2022.09.16 |
임시form을 생성 하여 ajax로 form 전송 하기. (0) | 2022.09.01 |
Comments