hidden modules

More
8 years 1 month ago #46298 by dh12355@gmx.de
i use Joomla 3.4.6 and sparky 2.20

i read from you in another Topic #37556 to change thje line in the index.php into:

<?php
$browser = JBrowser::getInstance();
$mobile_class = $browser->isMobile() ? " mobile" : " desktop";
?>

<body<?php if ($menu->getActive() == $menu->getDefault()) { echo ' class="sparky_home".$mobile_class'; }else{ echo ' class="sparky_inner"'.$mobile_class; } ?>>

and than in template_css.css

add at bottom:

.mobile .hidden-phone{
display:none!important;
}


.desktop .hidden-desktop{
display:none!important;
}

i have all thinks done and put in one modul " hidden-desktop" and another modul " hidden-phone".

the result is that both modules are complete hidden on desktop and phone.
Whats the problem?

maklerfinder24.de/

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
8 years 1 month ago #46299 by milos
Replied by milos on topic hidden modules
Hello,

The feature that you described on your post is not available in sparky and we can't support it. If you want to hide any element on smaller screen sizes, simply use media queries in your CSS file and display:none property for such element(s).

Regards,
Milos

Please Log in to join the conversation.

More
8 years 1 month ago #46300 by dh12355@gmx.de
Replied by dh12355@gmx.de on topic hidden modules
but you wrote this in #37556 that this must be modify and than it works so???

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
8 years 1 month ago #46301 by milos
Replied by milos on topic hidden modules
Please give me link of this topic.

Thanks

Please Log in to join the conversation.

More
8 years 1 month ago #46302 by dh12355@gmx.de

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
8 years 1 month ago - 8 years 1 month ago #46303 by milos
Replied by milos on topic hidden modules
This is a very old topic (2 years) and there are easier ways to achieve what you need. Whatever you want to remove from site on mobiles (smaller screens), just do it from CSS. In example, if you want to remove an element that has class .hideonmobiles on all screens smaller than 400px in width, add this at the bottom of template_css.css file:
Code:
@media (max-width: 400px) { .hideonmobiles { display:none; } }

Now, all elements that have class .hideonmobiles will be hidden on screens that are less than 400px wide.

Simple as that.

Why is that better? Because the screen width matters, not device type. Some mobile devices can have very big screens, also, some desktops can have very small windows (if user resize it).

Regards,
Milos
Last edit: 8 years 1 month ago by milos.

Please Log in to join the conversation.

Time to create page: 0.288 seconds
Powered by Kunena Forum