Jquery toggles not working

Hello all i have several section where i’d like to use toggles to hide/show info and then masonry so align it.
I have a sample here in this code pen.

It is not working. I’ll also add that i’d have several such sections throught one page.
I tried using

.detail .specs{
box-sizing: border-box;
.detail .specs img{
margin:0px auto;
.detail .specs>p{
```to hide the text below the images used for toglles & 

.detail .specs p{

that didn't work either.
Could i please get some advice on how to fix this?
thank you

At the moment, there’s nothing to toggle. If you initially hide the spec- divs, then there’s something to toggle. E.g.

.specs + div {display: none;}

As an aside, don’t include the link the jQuery in the HTML. Click the JS gear icon and choose to include jQuery on the page.

Also, that code is quite inefficient. You don’t need to target each item separately in your code.

Hi ralph have managed to hide the text i wanted w/

	.rwd.desktop .detail p {
		padding: 10px 5px 5px 5px;
		display: none;

Thanks for the tip on the jquery linking have not used codepen a lot yet.
As for the code i have been told it could be better.
was thinking of this



Seems to work could you please offer some advice on improving on it? Also now i can’t seems to reproduce it in the codepen but while i have succsfully hidden the text my images and specs divs that are ‘’’ display:inline-block``` and were doing so before are now stacking up on top of each other.

ok so i got it to work

*toggles the items off/on or on/off




however had to put the css back to

		padding: 10px 5px 5px 5px;
		display: block;

as the text was not showing when toggled. & everything is still stacked on top of each other.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.