/    Sign up×
Community /Pin to ProfileBookmark

JavaScrip bug

Hi,
I have this “gallery” that has a main img and text and I want to change the img and the text with the img that I am clicking on and with it’s text. The problem is that the second img text has a class of hide and for some reason I can;t remove it !
The gallery should work like this one: https://codepen.io/raul-rogojan/pen/QXvXWE?editors=0010
But I don’t know why when I am implementing it into my site this line of code doesn’t work anymore.

[code]logosMain.lastElementChild.classList.remove(‘hide’);[/code]

Here are the files for my site. https://github.com/CodyHiII/Second-Portfolio
The gallery is in the main tag !

to post a comment
CSSHTMLJavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumJun 25.2019 — I didn't test it, but obviously the reason is that you placed your figcaptions [b]outside[/b] the figure tag:
<figure>
<img src="img/lavish logo.jpg" alt="logo1">
</figure>
<figcaption class="hide">
<h2>AAA</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nesciunt animi aliquid corporis omnis eum. Quis quaerat aliquid sunt dignissimos?</p>
</figcaption>

Shift it inside and it should work:
<figure>
<img src="img/lavish logo.jpg" alt="logo1">
<figcaption class="hide">
<h2>AAA</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nesciunt animi aliquid corporis omnis eum. Quis quaerat aliquid sunt dignissimos?</p>
</figcaption>
</figure>


Copy linkTweet thisAlerts:
@codyhillauthorJun 25.2019 — @Sempervivum#1605323 omg thx, xd I can't believe that I stayed all day yesterday on that . I tough the the problem was with the main
×

Success!

Help @codyhill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...