floating botton - default open

Thanks for this modul

I have only one question:
I need the button as default as always open - to show all item
the basic state in the moment ist close.

How can I change this?
3 years 6 months ago #1 by Josef

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

  • Posted by TemplatePlazza (5261) Offline
Hi, open file .. modules/mod_floating_buttons/tmpl/default.php with your php editor (or alternatively you can add a template override).

Add this code
jQuery('#floatingbtn button').click();
after the code
jQuery('#floatingbtn').jqueryFab(links, options);
3 years 6 months ago #2 by TemplatePlazza

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

maybe i got that wrong.
I open the file and insert before <script> jQuery('#floatingbtn button').click();
and after </script> jQuery('#floatingbtn').jqueryFab(links, options);

but ist not running ;)

The hole file:

<?php
/**
* @copyright Copyright © 2020 - All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author templateplazza.com
*/
defined('_JEXEC') or die;
?>
<div id="floatingbtn" class="<?php echo $tooltip_class.$visibility_class; ?>"></div>

jQuery('#floatingbtn button').click();
<script>
jQuery('#floatingbtn button').click();
jQuery(document).ready(function(){
var links = [
<?php if($main_item_icon_custom) {
$main_item_icon = "<img class='main_item_icon_custom' src='".JURI::base(true)."/".$main_item_icon_custom."' alt=''/>";
}else{
$main_item_icon = $main_item_icon;
} ?>
{
"bgcolor":"<?php echo $main_item_bgcolor;?>",
"icon":"<?php echo $main_item_icon;?>",
"color":"<?php echo $main_item_color;?>",
},
<?php
foreach ($child_item_items as $item) :
if(in_array($item->access, $levels)) :
$child_item_icon_custom = $item->child_item_icon_custom;
if($child_item_icon_custom){
$child_item_icon = "<img class='child_item_icon_custom' src='".JURI::base(true)."/".$item->child_item_icon_custom."' alt=''/>";
}else{
$child_item_icon = $item->child_item_icon;
}
?>
{
"tooltip":"<?php echo $item->child_item_title; ?>",
"url":"<?php echo $item->child_item_url; ?>",
"bgcolor":"<?php echo $item->child_item_bgcolor; ?>",
"color":"<?php echo $item->child_item_color; ?>",
"icon":"<?php echo $child_item_icon; ?>"
},
<?php
endif;
endforeach; ?>
];
var options = {
rotate: <?php echo $main_item_is_rotated;?>
};
jQuery('#floatingbtn').jqueryFab(links, options);
})

</script>
jQuery('#floatingbtn').jqueryFab(links, options);
3 years 6 months ago #3 by Josef

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

  • Posted by TemplatePlazza (5261) Offline
You put it wrong. Put it in the line 47, after jQuery('#floatingbtn').jqueryFab(links, options);
3 years 6 months ago #4 by TemplatePlazza

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

Thanks so much - you´re right and its running

In german we said:
Who can read has a clear advantage ;-)
3 years 6 months ago #5 by Josef

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

  • Posted by TemplatePlazza (5261) Offline
You're most welcome. Glad could help ;)
3 years 6 months ago #6 by TemplatePlazza

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

Powered by Kunena Forum