custom css class for image field

More
11 years 3 months ago #46037 by kath
hi there (long time no see :))

how could i add custom css classes to the otput of FC-image-fields?

i'm aware of the opening and closing texts for the field, and the prefix and suffix text for the field's value(s), but i want to be able to add to the the 'fc_field_image'-class.

thanks in advance!
kath :)

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #46038 by ggppdk
Hello

1. you need this due to the fact that you use some 3rd party JS library , on which you have no control ?


-- you can enclose img into some span with class and then call your 3rd party JS that attaches custom behavior with an appropriate jQuery selector

e.g. enclose in <span class="myclass"> <img>... </span>

and then use:
Code:
jQuery( document ).ready(function() { jQuery(".myclass img").customJsMethod(); });

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #46057 by kath
thanks ggppdk. i'm aware of that, but I really want to avoid cluttering the dom with nesting tags; I use bootstrap (could be any other css-framework or -method, too, for that matter) an i want to give the image field some classes from that framework -in this case.

my work-around for now is: use simple_dom.php to manipulate the img dom obj in my FC-template in a way that adds my class(es).

(i also want to avoid to copy the css-code into a selector called 'fc_field_image')

thanks anyway, maybe this is intersting for enough people to add it in the future...?

kath :)

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #49179 by kath
lol, i just ran into the same question again and found my own post. :)

so.. any chance we can add our own css-classes to the img-tag of our image-fields in the future?

apart from this, it's always great to works with FC!
kath

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #49182 by micker
thanks for return
actualy we work hard to produce 2.2 release ;)
after we do a migration too github and prepare a 2.3 ;)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.377 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save