ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > RocketCake
forum topic indicator Question about textstyles, classes, etc.
person icon
ivarforkbeard
Registered User
Quote
2024-11-13 19:54:56

I'm writing a little JS that can change up the visibility of different items using the class attribute. I was able to get it to work finally by examining the textstyle(x) class that was generated when I go to preview my site, but I am finding that when I "publish" it, RocketCake changes the textstyle(x) class to a different number - and if I make any significant changes, that number changes again. Is there a way to get that output to be more consistent? I also would like to find a way to hide a container using JS, but am a bit stumped at the moment... Help?

person icon
niko
Moderator
Quote
2024-11-14 07:33:18

For hiding / showing items, best is to put them into an own container: They have IDs which never change, and you can even specify your own ID (in the "HTML Code" dialog) if you like. Textstyle classes always change and are merged with other text styles depending how they appear on your website.

For hiding something using JavaScript and an ID, use something like this:

document.getElementById("yourid").style.display = "none";


person icon
ivarforkbeard
Registered User
Quote
2024-11-14 16:53:03

I have a list and a cursory "search" function that would be able to hide individual lines in the list as you were searching - it might be really, really challenging to put each line into a container? And also - they probably qualify more as a class than an ID?

person icon
niko
Moderator
Quote
2024-11-15 12:11:46

Hm.. in that case I'd programmatically do that somehow.. like putting each line into a span or div with its own id in the beginning and then hide it depending on what logic you are using. But I guess that totally depends on the details.

person icon
g4hdu
Registered User
Quote
2024-11-17 09:15:18

my solution to this is (I use jQuery by the way) is to put it in a container (div) and then use something like .find() or $("mydivID span").

Another solution I use is to add a class and then $(".myClass")

Also look at :first or :last selectors in css

Bear with me, I'm not saying these are the best actions but they work for me.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |