Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
How to change Pseudo values with JavaScript

I want to do custom cursor with before and after elements. How can I select and change values before and after elements with JavaScript?

        .a-Cursor::before {
            content: ''; display: block;
            width: 18px; height: 18px;
            border: 2px solid #353B48;
            border-radius: 50%; position: absolute;
            top: attr(top-Pos); left: attr(left-Pos);
        }
    </style>
</head>
<body>
    <div class='page-Body'>
        <div class='a-Cursor'>
            
        </div>
    </div>

    <script>
        const aCursor = document.querySelector('.a-Cursor');

        document.addEventListener('mousemove', function(e) {
            aCursor.setAttribute('top-Pos', (e.pageY - 9) + 'px');
            aCursor.setAttribute('left-Pos', (e.pageX - 9) + 'px');
        });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found an answer. I do not know this is good or bad.

I will be here for better solutions.

.a-Cursor::before {
            content: ''; display: block;
            width: 18px; height: 18px;
            border: 2px solid #353B48;
            border-radius: 50%; position: absolute;
            top: var(--top-Pos); left: var(--left-Pos);
        }
    </style>
</head>
<body>
    <div class='page-Body'>
        <div class='a-Cursor'>
            
        </div>
    </div>

    <script>
        const aCursor = document.querySelector('.a-Cursor');

        document.addEventListener('mousemove', function(e) {
            aCursor.style.setProperty('--top-Pos', (e.pageY - 9) + 'px');
            aCursor.style.setProperty('--left-Pos', (e.pageX - 9) + 'px');
        });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!