I'm dealing with a Wordpress site, so I have limited access to what I can add or not and where. I had to use :before and :after pseudo elements to add two arrow icons. these icons are supposed to achieve some scrolling in the div element they are part of when they are clicked.
<div class="thumbs-gallery">
::before
<div class="thumb"></div>
<div class="thumb"></div>
<div class="thumb"></div>
<div class="thumb"></div>
<div class="thumb"></div>
::after
</div>
The way this is set up, you can only see 2 thumbs as "thumbs-gallery" has a fixed height and an overflow set to auto.
.thumbs-gallery {
width: 135px;
float: right;
margin-top: -601px;
height: 506px;
overflow: auto;
}
.thumbs-gallery::before {
content: "";
display: block;
background: url('...') no-repeat;
background-size: 37px 25px;
width: 38px;
height: 25px;
position: absolute;
left: 830px;
top: -630px;
}
.thumbs-gallery::after {
content: "";
display: block;
background: url('...') no-repeat;
background-size: 37px 25px;
width: 38px;
height: 25px;
position: absolute;
left: 830px;
top: -50px;
-webkit-transform: rotate(180deg);
}
How can I target the before and after pseudo elements with JQuery and have it scroll the content inside of "thumbs-gallery" up and down?