Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Same code doing different things on different pages


Trishyeah

Question

Hi folks,

I have code that allows me to create FAQ dropdowns on my site, however it does expand like the accordian on one page, but not the other, but I believe it's the exact same code!


I have this code on 2 different pages on my site

https://chromatical.com.au/faq

and 

https://chromatical.com.au/chromatical-club (it's a long page and it's nearer the bottom end - just search FAQ)

The code I'm using involves the code inside the markdown, and also code that gets hidden in the bottom of each page. 

The code works as required on the FAQ page - (The boxes open and close when clicked to reveal the answers to the questions)

However on the second page, the boxes do not expand and I can't figure out why as I didn't do anything different.

Hope someone can help!

Link to comment

17 answers to this question

Recommended Posts

  • 0

Try to replace the code in your footer with this

$(document).on("click", '.markdown-block h4', function() {
      $(this).toggleClass('open').children('*:not(h4)').slideToggle(); 
});

image.png.4714bd2c962e61b0281485f6787c388f.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
5 minutes ago, bangank36 said:

Try to replace the code in your footer with this


$(document).on("click", '.markdown-block h4', function() {
      $(this).toggleClass('open').children('*:not(h4)').slideToggle(); 
});

image.png.4714bd2c962e61b0281485f6787c388f.png

Gday! Thanks heaps, I'll give it a go. Should I do this on both pages considering it's the same code? Just in case the other page breaks too?

 

Link to comment
  • 0
1 minute ago, Trishyeah said:

Gday! Thanks heaps, I'll give it a go. Should I do this on both pages considering it's the same code? Just in case the other page breaks too?

 

Both page is good, let's update this markdown to use this from now on, but it still need you to add to see if it work

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0

Hmm no still not working on my end 😞 

This is my full code!

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
 $(document).ready(function () {
  $(document).on("click", '.markdown-block h4', function() {
      $(this).toggleClass('open').children('*:not(h4)').slideToggle(); 
});
    }); 
</script>
<style>
body:not(.sqs-edit-mode) .markdown-block h4 {
    display: block !important;
     cursor: pointer;
}
  body:not(.sqs-edit-mode) .markdown-block h4 + blockquote {
    display: none;
}
    body:not(.sqs-edit-mode) h4.open + blockquote {
    display: block;
}
  body:not(.sqs-edit-mode) .markdown-block blockquote {
    margin-left: 0;
    margin-right: 0;
}
  .markdown-block h4 {
    background: #fdeef3;
    padding: 10px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #000000;
}
  .markdown-block h4 + blockquote {
    background: #fdeef3;
    margin-top: 0;
    padding: 20px;
}
</style>

Link to comment
  • 0

That's weird, you can invite me as collaborator to fix issue directly bangank36@gmail.com

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
3 hours ago, bangank36 said:

That's weird, you can invite me as collaborator to fix issue directly bangank36@gmail.com

4 hours ago, bangank36 said:

Try to replace the code in your footer with this



$(document).on("click", '.markdown-block h4', function() {
      $(this).toggleClass('open').children('*:not(h4)').slideToggle(); 
});

image.png.4714bd2c962e61b0281485f6787c388f.png

Gday! Thanks heaps, I'll give it a go. Should I do this on both pages considering it's the same code? Just in case the other page breaks too?

3 hours ago, bangank36 said:

That's weird, you can invite me as collaborator to fix issue directly bangank36@gmail.com

Heya I just added you as a contributor thank you SO SO SO much! 

We are talking in another issue as well which you might be able to look at while you're in there (if that's okay).

It's this issue - https://forum.squarespace.com/topic/173734-code-only-sometimes-displays-correctly/#comment-410135

 

Link to comment
  • 0
1 hour ago, Trishyeah said:

Gday! Thanks heaps, I'll give it a go. Should I do this on both pages considering it's the same code? Just in case the other page breaks too?

Heya I just added you as a contributor thank you SO SO SO much! 

We are talking in another issue as well which you might be able to look at while you're in there (if that's okay).

It's this issue - https://forum.squarespace.com/topic/173734-code-only-sometimes-displays-correctly/#comment-410135

 

There is a duplication script on "HOW CAN YOU JOIN?" section, I removed and it worked

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
1 hour ago, Trishyeah said:

Gday! Thanks heaps, I'll give it a go. Should I do this on both pages considering it's the same code? Just in case the other page breaks too?

Heya I just added you as a contributor thank you SO SO SO much! 

We are talking in another issue as well which you might be able to look at while you're in there (if that's okay).

It's this issue - https://forum.squarespace.com/topic/173734-code-only-sometimes-displays-correctly/#comment-410135

 

The second issue happen once or twice but I can't find the root cause I placed the stylesheet directly in section, hope that help

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
11 hours ago, bangank36 said:

The second issue happen once or twice but I can't find the root cause I placed the stylesheet directly in section, hope that help

@bangank36 Also, (I commented above about the FAQ not working) But also, thank you SO much for your help with the weird section! I mentioned there were two pages with this issue, this is the other one https://chromatical.com.au/chromatical-club (right down the bottom) is there any chance you could put the stylesheet there as well? Thank you SO very much for your time I'm mighty grateful.

Link to comment
  • 0
1 hour ago, Trishyeah said:

@bangank36Oh no, it's still not working for me on mobile or desktop :(:( The FAQ doesn't expand/close still but still works correctly on the other page. So strange!

IT's been working here, I just record a video

chrome-capture (2).gif

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0

Try ti clear browser cache

 

Screenshot_20201113-073342_Samsung Internet.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0

added on https://chromatical.com.au/chromatical-club (

where is other page

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
2 minutes ago, Trishyeah said:

place it there, if issue persist, you can post another topic some other designer may help

image.thumb.png.ba114982aaeaef82350c4248191b16bd.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Portfolio hover Replace Link Style
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...