Uikit Accordion

I know this is really a Uikit problem but I thought I would ask here as the community support for uikit seems a bit thin on the ground at the moment. I've read all the documentation and still can't work out how to do this.

When using the uikit accordion there's an initial flash of content on page load before it's collapsed. I know there's various work arounds for this like hiding the content until the body has loaded etc but I'm just not sure how to implement them. Is it even possible for example to add an onload event to the body tag of every page via beans markup?

$body_id = 'beans_body';
$attribute_name = 'onload';
$attribute_value = 'doSomething()';

beans_add_attribute( $body_id, $attribute_name, $attribute_value );

Thanks for the help, I'll give that a try.

I actually made a work around by including the same inline style that's dynamically added to the accordion div ie: position: relative; height:0; and overflow:hidden; to the document head via functions.php

This means it gets fired off quicker and so flashes for less time, I combined that with some margin so now the accordin content doesn't show at all. It feels like a bit of a hack though so maybe I can use your method to find a more elegant solution.

Hey Keith. It would be great if you could post a solution if one surfaced. Have a great day!

Write a reply

Login or register to write a reply, it's free!