Need help making Accordian work in RSD

User 2798098 Photo


Registered User
5 posts

Hi,

Been trying to duplicate the simple 'accordion' with RSD and JQuery, but unfortunately, without success. Have to add though that I don't know the first thing about working with scripts (I merely copied what I saw in the video), so that's probably the reason why it doesn't work.
I've prepared a little ZIP-file containing my RSD document as well as the export of that document:
http://users.telenet.be/deridderpiet.be … ordion.zip
I'd very much appreciate if one of you experienced people could have a look at it to see where I've messed up, and maybe provide me with clear instructions — if you assume I know next to nothing about coding, you assume correctly — on how to address the issue.

Thanks very, very much in advance!

_
User 187934 Photo


Senior Advisor
20,266 posts

Hi Piet,
You don't have JQuery in your resources.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2798098 Photo


Registered User
5 posts

Hi Eric,

Thanks!
I thought I only needed to put the file "jquery-ui.min.js" into the js-directory... Do I need more?

User 187934 Photo


Senior Advisor
20,266 posts

Give this a try.
http://ericrohloff.com/coffeecup/ccforu … ordion.zip
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2798098 Photo


Registered User
5 posts

Hi Eric,

That works great! Thanks so much.

However, this appears to be an entirely different approach to the Accordeon-thing, and now I am at a bit of a loss on how to format the various parts of the HTML-element which you've used.
See, eventually, I want the accordeon to be part of this page: http://users.telenet.be/deridderpiet.be … mePage_v3/ (This page is still very much in a sketchy state, by the way.)
The section in the centre, with the five grey bars and attached paragraps need to 'accordeonize' so to speak, which is why the technique as demonstrated in the video (with the button links in the container and the minuscule js-script) seemed to me to be the ideal approach for my purposes ...
If you have any suggestion on how to best proceed, given what my goal is, I'd really appreciate!

Thanks again,

Piet
User 187934 Photo


Senior Advisor
20,266 posts

Remove the styling link.
<link rel="stylesheet" href="jquery/jquery-ui.theme.css">
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2798098 Photo


Registered User
5 posts

Thanks, Eric.
Still not quite what I'm after though, I'm afraid. (In order to get that formatted the way I'd like, it needs plenty more code, it seems to me: how do I get those grey bars in there? And the correct spacing and text alignment? And the typeface?

Again: I really would like to know why my duplication of what was demonstrated in that video, doesn't work. As far as I can tell, I've done everything to the letter — I've now even added the complete jquery folder to the resources — but still no go.
The only thing I can think of is that my transcription of that code is somehow not quite accurate. For example, does the number of spaces at a beginning of a line matter?
Could you perhaps post that snippet of code exactly as it needs to be entered in the Footer area?

Thanks again!

_
User 187934 Photo


Senior Advisor
20,266 posts

You can apply a style to the accordion <div> <h> and <p> by using a class already available in RSD.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

I think you're missing some of your script?
Here's a sample accordian from one of my sites:
<script>
$(document).ready(function() {
$( ".hidetext1" ).click(function() {
$( "#text1" ).slideToggle( "slow" );
});
$( ".hidetext2" ).click(function() {
$( "#text2" ).slideToggle( "slow" );
});
$( ".hidetext3" ).click(function() {
$( "#text3" ).slideToggle( "slow" );
});
});
</script>

Each ID (#text1 etc.) corresponds to a specific accordian header/button in the HTML:
<div class="hidetext1 toggle">Button Text</div>
<div class="text" id="text1" style="display: none;">
<p> text here </p>
<div class="hidetext1 toggle">Close Button (optional)</div>

I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 434929 Photo


Ambassador
938 posts

Piet none of your elements inside the container
Try this now
http://demo.coffeecup.com/storage/zip/accordion.zip

This is the script you use in footer.
<script src="js/jquery-ui.min.js"></script>
<script>
$(function() {
$( "#accordion" ).accordion();
});
</script>
==================

there is a problem with your script , can you see the differences?
<script>
$(function() {
$( “#accordion” ).accordion();
});
</script>
Guys at coffeecup are awesometacular.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.