Upwork 복제 슬라이딩 페이지 문제 (JS)를 수정하려면 어떻게해야합니까?

random_18

upwork를 사용했다면 UI에 익숙 할 것입니다.
여기서는 사용자가 프리랜서 구인을 클릭하면 왼쪽에서 다른 페이지가 열릴 때 작은 기능으로 만들려고 transform: translate(120%)했습니다.transform: translate(0)


문제는 오른쪽에서 왼쪽으로 슬라이딩하는 작업 헤더를 클릭하면 완벽하게 작동하지만 동일한 작업을 두 번째로 수행하면 슬라이딩이 작동하지 않는다는 것입니다. 또한 슬라이드가 오른쪽에서 왼쪽으로 올 때 페이지 오른쪽에 회색 막대가 나타납니다. 당신이 내 설명에 만족한다면 내가 무엇을하는지 모르겠습니다. 나는 그것에 대해 더 자세히 설명하려고 노력할 것입니다.

스크린 샷

const jobContainer = document.querySelector('.job-description');
let htag = document.querySelector('.green-h3');
function changeCol() {
    htag = document.querySelector('.green-h3');
    htag.style.color = "green"
}

function normalCol() {
    let htag = document.querySelector('.green-h3');
    htag.style.color = "black"
    htag.style.borderBottom = `none`
}

htag.addEventListener('mouseover', ()=> {
    htag.style.borderBottom = `1.5px solid green`
});



// show more
let hiddenInfo = document.querySelector('.by-default-hidden');
let more = document.querySelector('.more');
let less = document.querySelector('.less');
less.style.display = 'none'
more.addEventListener('click', ()=> {
    hiddenInfo.style.display = 'inline'
    more.style.display = 'none'
    less.style.display = 'inline'
})

less.addEventListener('click', ()=> {
    hiddenInfo.style.display = 'none'
    more.style.display = 'inline'
    less.style.display = 'none'
})


// sliding

let headingTag = document.querySelector('.green-h3');
let slidingParent = document.querySelector('.container-job-slide')
let slidingContent = document.querySelector('.slide-jobs');
let jobSectionmain = document.querySelector('.jobs');
let backIcon = document.querySelector('.back-icon');
headingTag.addEventListener('click', ()=> {
    
    document.body.setAttribute("data-theme", "blur")
    if (headingTag) {
        slidingContent.style.display = 'block';
    } else {
        slidingContent.style.display = 'none';
    }
})

backIcon.addEventListener('click', ()=> {
    slidingContent.style.transform = `translateX(120%)`;
    document.body.removeAttribute("data-theme", "blur");
});
body {
    max-width: 990px;
    overflow-x: hidden;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    background-color: #F1F2F4;
    margin: 0 auto;
}

body[data-theme="blur"] {
    background-color: rgb(87, 87, 87);
}


.jobs {
    position: relative;
}

.container-job {
    max-width: 630px;
    position: relative;
}


h1 {
    padding: 20px 10px 20px 40px;
    background-color: white ;
}

.job-description {
    margin-top: -20px;
    border-top: 1px solid rgb(194, 194, 194);
    padding: 20px 20px 20px 40px;
    background-color: white;
    color: #656565;
}

.job-description:hover{
    color: black;
    background-color: #F9F9F9;
    cursor: pointer;
}
.more,.less {
    color: green;
}
.more:hover,.less:hover {
    border-bottom: 1.5px solid green;
    cursor: pointer;
}
.green-h3 {
    font-size: 1.2rem;
}

.green-h3:hover  {
    border-bottom: 1.5px solid green;
}

.by-default-hidden {
    display: none;
}

/* slide jobs */

.slide-jobs {
    top: 0;
    position: absolute;
    /* */
    display: none;
    right: 5%;
    width: 80%;
    transition: all .4s;
    animation: slide .4s ease-in;
}
@keyframes slide {
    from {
        transform: translateX(100%); 
    }
    to {
        transform: translateX(0); 
    }
}
/* .backSlide {
    animation: backSlide .4s ease-in;
}

@keyframes backSlide {
    from{
        transform: translateX(0%);
    } 
    to {
        transform: translateX(120%);
    }
} */

.job-description-slide {
    margin-top: -20px;
    border-top: 1px solid rgb(194, 194, 194);
    padding: 20px 20px 20px 40px;
    background-color: white;
}
.back-icon div{
    height: 4px;
    width: 20px;
    margin: 5px;
    background-color: green;
    cursor: pointer;
}
.back-icon {
    background-color: white;
    padding: 25px;
}
.line1 {
    transform: rotate(-30deg);
}
.line2 {
    transform: rotate(30deg);
}
<section class="jobs">
      <div class="container-job">
        <h1>My Feed</h1>
        <div
          onmouseover="changeCol();"
          onmouseout="normalCol()"
          class="job-description"
        >
          <span class="green-h3">SEO Specialist Needed</span>
          <h4>
            Fixed-price - Expert - Est. Budget: 400$ - Posted 46 minutes ago
          </h4>
          <p>
            Job Description Hello! Our small digital advertising company needs
            someone that's starting out in their career that is **VERY** capable
            in SEO and web development. Must be able to do a video call and
            operate in US Eastern Time. Also must be comfortable with Wordpress.
            If you also have some graphic design background and know about
            Facebook / Google Ads and could manage those, that's a
            <span class="more">more</span>
            <span class="by-default-hidden"
              >significant plus. Our team also needs someone that's very
              comfortable in Wordpress back end HTML / CSS / PHP, and can
              essentially create a site from visuals provided. Pay is not
              fantastic YET, but it should be once we really have clients coming
              through. Must be able to do a video call every now and then, and
              video interview on front end. Key summary: we need an SEO expert
              to manage search engine optimization and marketing activities. The
              SEO Specialist will be responsible for managing all SEO activities
              such as keyword strategy, content strategy and link building to
              increase organic search rankings and drive search traffic from
              Google, Bing, Yahoo and other search engines. A successful SEO
              specialist must keep up-to-date with the latest industry best
              practices and work closely with editorial and marketing teams to
              develop a successful organic search strategy. Responsibilities
              Optimize copy and landing pages for search engine optimization
              Perform ongoing keyword research and discovery, expansion and
              optimization Research and implement search engine optimization
              recommendations on the website Research and analyze competitor
              content and links Develop and implement link building strategy
              Work with the development team to ensure SEO best practices are
              properly implemented on newly developed code Work with editorial
              and marketing teams to drive SEO in content strategy and creation
              Work closely with social media team to align social distribution
              and SEO efforts Recommend changes to website architecture,
              content, linking and other factors to improve SEO positions for
              target keywords Skills Proven SEO experience and a track record of
              success growing organic search traffic and conversions Solid
              understanding of performance marketing, conversion, and online
              customer acquisition Up-to-date with the latest trends and best
              practices in SEO and inbound marketing In-depth experience with
              website analytics tools (e.g, Google Analytics, NetInsight,
              Omniture, WebTrends) Working knowledge of HTML, CSS, and
              JavaScript development and constraints Familiarity with content
              management systems (e.g, Wordpress, Vignette) BS/MS degree in a
              quantitative, test-driven field Job Type: Part-time Pay: From
              $20.00 per hour</span
            >
            <span class="less">Less</span>
          </p>
        </div>
      </div>
    </section>
    <section class="slide-jobs">
      <div class="container-job-slide">
        <div class="back-icon">
          <div class="line1"></div>
          <div class="line2"></div>
        </div>
        <h1>SEO Specialist Needed</h1>
        <div class="job-description-slide">
          <span class="green-h3">SEO Specialist Needed</span>
          <h4>
            Fixed-price - Expert - Est. Budget: 400$ - Posted 46 minutes ago
          </h4>
          <p>
            Job Description Hello! Our small digital advertising company needs
            someone that's starting out in their career that is **VERY** capable
            in SEO and web development. Must be able to do a video call and
            operate in US Eastern Time. Also must be comfortable with Wordpress.
            If you also have some graphic design background and know about
            Facebook / Google Ads and could manage those, that's a significant
            plus. Our team also needs someone that's very comfortable in
            Wordpress back end HTML / CSS / PHP, and can essentially create a
            site from visuals provided. Pay is not fantastic YET, but it should
            be once we really have clients coming through. Must be able to do a
            video call every now and then, and video interview on front end. Key
            summary: we need an SEO expert to manage search engine optimization
            and marketing activities. The SEO Specialist will be responsible for
            managing all SEO activities such as keyword strategy, content
            strategy and link building to increase organic search rankings and
            drive search traffic from Google, Bing, Yahoo and other search
            engines. A successful SEO specialist must keep up-to-date with the
            latest industry best practices and work closely with editorial and
            marketing teams to develop a successful organic search strategy.
            Responsibilities Optimize copy and landing pages for search engine
            optimization Perform ongoing keyword research and discovery,
            expansion and optimization Research and implement search engine
            optimization recommendations on the website Research and analyze
            competitor content and links Develop and implement link building
            strategy Work with the development team to ensure SEO best practices
            are properly implemented on newly developed code Work with editorial
            and marketing teams to drive SEO in content strategy and creation
            Work closely with social media team to align social distribution and
            SEO efforts Recommend changes to website architecture, content,
            linking and other factors to improve SEO positions for target
            keywords Skills Proven SEO experience and a track record of success
            growing organic search traffic and conversions Solid understanding
            of performance marketing, conversion, and online customer
            acquisition Up-to-date with the latest trends and best practices in
            SEO and inbound marketing In-depth experience with website analytics
            tools (e.g, Google Analytics, NetInsight, Omniture, WebTrends)
            Working knowledge of HTML, CSS, and JavaScript development and
            constraints Familiarity with content management systems (e.g,
            Wordpress, Vignette) BS/MS degree in a quantitative, test-driven
            field Job Type: Part-time Pay: From $20.00 per hour
          </p>
        </div>
      </div>
    </section>

엔젤 데이 코프

코드의 일부 위치에서 js 코드는 다음과 같은 요소를 선택할 때 '대신'가 있습니다.

htag.style.borderBottom = `1.5px solid green`
// should be
htag.style.borderBottom = '1.5px solid green'

고쳐주세요! 슬라이딩 문제에 대한 코드에서 작은 수정이 필요합니다.

headingTag.addEventListener('click', () => {
  document.body.setAttribute("data-theme", "blur");
  slidingContent.style.transform = "translateX(0)";
  slidingContent.style.display = 'block';
})

backIcon.addEventListener('click', () => {
  slidingContent.style.transform = "translateX(120%)";
  document.body.removeAttribute("data-theme", "blur");
});

두 번째 문제에 대해이 줄은 실제로 슬라이딩 콘텐츠 내부의 h1 태그에서 여백이므로 다음을 추가하여 제거하십시오.

....
    </div>
    // set margin top to 0
    <h1 style="margin-top:0!important;">SEO Specialist Needed</h1>
    <div class="job-description-slide">
....

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

슬라이딩 메뉴를 제거하려면 어떻게해야합니까?

분류에서Dev

절대 위치를 사용하지 않고 슬라이더를 수평으로 정렬하려면 어떻게해야합니까? CSS 문제

분류에서Dev

인수는 _가 '정적-이 문제를 해결하려면 어떻게해야합니까?

분류에서Dev

홈페이지에서 삭제 된 후크를 복원하려면 어떻게해야합니까?

분류에서Dev

페이지 당 표시되는 이미지 수를 제한하려면 어떻게해야합니까?

분류에서Dev

내 웹 사이트의 페이지 당 블로그 수를 제한하려면 어떻게해야합니까?

분류에서Dev

Mongo DB의 Angular 페이지에서 선택한 문서를 제거하려면 어떻게해야합니까?

분류에서Dev

USB 드라이브를 정확히 복제하려면 어떻게해야합니까?

분류에서Dev

Ubuntu 16.04 및 17.04에서이 정지 문제를 해결하려면 어떻게해야합니까?

분류에서Dev

페이지 매김으로 반환되는 링크 수를 제한하려면 어떻게해야합니까?

분류에서Dev

Javascript 한국어 인코딩 문제-github 페이지 이미지 404 비동기 오류를 해결하려면 어떻게해야합니까?

분류에서Dev

내 SQL 데이터베이스를 정확히 복제하려면 어떻게해야합니까?

분류에서Dev

메타 설명을 위해 페이지 콘텐츠를 복사하고 php 또는 js로 150 자로 제한하려면 어떻게해야합니까?

분류에서Dev

Kentico에서 어제 페이지보기 통계를 표시하려면 어떻게해야합니까?

분류에서Dev

컨트롤러 이름을 복제하지 않고 Rails 4 라우팅 네임 스페이스를 작성하려면 어떻게해야합니까?

분류에서Dev

특정 개수의 파일이있는 폴더를 삭제하려면 어떻게해야합니까?

분류에서Dev

dd 명령을 사용하여 USB 드라이브를 복제하려면 어떻게해야합니까?

분류에서Dev

display : none없이 중복 이미지를 제거하려면 어떻게해야합니까?

분류에서Dev

초급 문제. 제품의 모든 이미지를 표시하려면 어떻게해야합니까? Django + Python

분류에서Dev

문자열에서 소수점이 아닌 마침표를 제거하려면 어떻게해야합니까?

분류에서Dev

문자열이 포함 된 변수를 제거하려면 어떻게해야합니까?

분류에서Dev

특정 조건에서 WooCommerce의 결제 페이지에서 "주문"텍스트를 변경하려면 어떻게해야합니까?

분류에서Dev

모든 Docker 이미지를 제거하려면 어떻게해야합니까?

분류에서Dev

K8S : 복제본이없는 배포를 삭제하려면 어떻게해야합니까?

분류에서Dev

Chrome에서 웹 페이지를 세로 모드로 강제 인쇄하려면 어떻게해야합니까?

분류에서Dev

내 PHP 페이지에서 .php 확장자를 제거하려면 어떻게해야합니까?

분류에서Dev

인터페이스에 부울 변수를 제공하려면 어떻게해야합니까?

분류에서Dev

Java의 인코딩을 모르는 인터넷 페이지에서 줄 바꿈 문자를 제거하려면 어떻게해야합니까?

분류에서Dev

Redmine이 자동으로 문제를 참조하지 못하도록하려면 어떻게해야합니까?

Related 관련 기사

  1. 1

    슬라이딩 메뉴를 제거하려면 어떻게해야합니까?

  2. 2

    절대 위치를 사용하지 않고 슬라이더를 수평으로 정렬하려면 어떻게해야합니까? CSS 문제

  3. 3

    인수는 _가 '정적-이 문제를 해결하려면 어떻게해야합니까?

  4. 4

    홈페이지에서 삭제 된 후크를 복원하려면 어떻게해야합니까?

  5. 5

    페이지 당 표시되는 이미지 수를 제한하려면 어떻게해야합니까?

  6. 6

    내 웹 사이트의 페이지 당 블로그 수를 제한하려면 어떻게해야합니까?

  7. 7

    Mongo DB의 Angular 페이지에서 선택한 문서를 제거하려면 어떻게해야합니까?

  8. 8

    USB 드라이브를 정확히 복제하려면 어떻게해야합니까?

  9. 9

    Ubuntu 16.04 및 17.04에서이 정지 문제를 해결하려면 어떻게해야합니까?

  10. 10

    페이지 매김으로 반환되는 링크 수를 제한하려면 어떻게해야합니까?

  11. 11

    Javascript 한국어 인코딩 문제-github 페이지 이미지 404 비동기 오류를 해결하려면 어떻게해야합니까?

  12. 12

    내 SQL 데이터베이스를 정확히 복제하려면 어떻게해야합니까?

  13. 13

    메타 설명을 위해 페이지 콘텐츠를 복사하고 php 또는 js로 150 자로 제한하려면 어떻게해야합니까?

  14. 14

    Kentico에서 어제 페이지보기 통계를 표시하려면 어떻게해야합니까?

  15. 15

    컨트롤러 이름을 복제하지 않고 Rails 4 라우팅 네임 스페이스를 작성하려면 어떻게해야합니까?

  16. 16

    특정 개수의 파일이있는 폴더를 삭제하려면 어떻게해야합니까?

  17. 17

    dd 명령을 사용하여 USB 드라이브를 복제하려면 어떻게해야합니까?

  18. 18

    display : none없이 중복 이미지를 제거하려면 어떻게해야합니까?

  19. 19

    초급 문제. 제품의 모든 이미지를 표시하려면 어떻게해야합니까? Django + Python

  20. 20

    문자열에서 소수점이 아닌 마침표를 제거하려면 어떻게해야합니까?

  21. 21

    문자열이 포함 된 변수를 제거하려면 어떻게해야합니까?

  22. 22

    특정 조건에서 WooCommerce의 결제 페이지에서 "주문"텍스트를 변경하려면 어떻게해야합니까?

  23. 23

    모든 Docker 이미지를 제거하려면 어떻게해야합니까?

  24. 24

    K8S : 복제본이없는 배포를 삭제하려면 어떻게해야합니까?

  25. 25

    Chrome에서 웹 페이지를 세로 모드로 강제 인쇄하려면 어떻게해야합니까?

  26. 26

    내 PHP 페이지에서 .php 확장자를 제거하려면 어떻게해야합니까?

  27. 27

    인터페이스에 부울 변수를 제공하려면 어떻게해야합니까?

  28. 28

    Java의 인코딩을 모르는 인터넷 페이지에서 줄 바꿈 문자를 제거하려면 어떻게해야합니까?

  29. 29

    Redmine이 자동으로 문제를 참조하지 못하도록하려면 어떻게해야합니까?

뜨겁다태그

보관