0 Пользователей и 1 Гость просматривают эту тему.
  • 5 Ответов
  • 636 Просмотров
*

ppb25

  • Захожу иногда
  • 54
  • 0 / 0
Добрый день. Подскажите, добрые люди, как скрыть отображение кнопки на мобильном устройстве (в десктопной должны быть видна) плагина "Skyline Scroll To Top". Я так понимаю как-то через медиа запросы, т.е.
Код
@media (max-width: 979px) {
  #absolute {
    display: none;
  }
Или как-то еще, подскажите, пожалуйста.

Вот сам файл скрола .php, его код

Код
<?php
/**
 * [member=126442]copyright[/member] Copyright (c) 2013 Skyline Software (http://extstore.com). All rights reserved.
 * @license GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die();

jimport('joomla.plugin.plugin');

/**
 * System - Scroll To Top Plugin
 *
 * @package Joomla.Plugin
 * @subpakage Skyline.ScrollToTop
 */
class plgSystemSL_ScrollToTop extends JPlugin {

/**
* Constructor.
*
* @param $subject
* @param array $config
*/
function __construct(&$subject, $config = array()) {
// call parent constructor
parent::__construct($subject, $config);
}

/**
* onAfterRoute Hook.
*/
function onAfterRoute() {
// initialize variables
$app = JFactory::getApplication();
$admin_enable = $this->params->get('admin_enable');

if (!$admin_enable && $app->isAdmin()) {
return;
}

$style = $this->params->get('style');
$text = htmlspecialchars($this->params->get('text'));
$title = htmlspecialchars($this->params->get('title'));
$duration = (int) $this->params->get('duration', 500);
$transition = $this->params->get('transition', 'Fx.Transitions.linear');
$custom_css = $this->params->get('custom_css');
$engine = $this->params->get('engine', 'mootools');
$image = $this->params->get('image', '');
$position = $this->params->get('position', 'bottom_right');
$border_radius = $this->params->get('border_radius', '3');
$offset_x = $this->params->get('offset_x', '20');
$offset_y = $this->params->get('offset_y', '20');
$padding_x = $this->params->get('padding_x', '12');
$padding_y = $this->params->get('padding_y', '12');
$background_color = $this->params->get('background_color', '#121212');
$color = $this->params->get('color', '#fff');
$hover_background_color = $this->params->get('hover_background_color', '#08C');
$hover_color = $this->params->get('hover_color', '#fff');

if ($image) {
$image = JHtml::_('image', $image, '', null, false, true);
}

//
$position_css = '';

switch ($position) {
case 'top_left':
$position_css = "left: {$offset_x}px; top: {$offset_y}px;";
break;
case 'top_right':
$position_css = "right: {$offset_x}px; top: {$offset_y}px;";
break;
case 'bottom_left':
$position_css = "left: {$offset_x}px; bottom: {$offset_y}px;";
break;
case 'bottom_right':
$position_css = "right: {$offset_x}px; bottom: {$offset_y}px;";
break;
}

$document = JFactory::getDocument();

$class = 'scrollToTop';

// Build Custom CSS
$css = <<<CSS
#scrollToTop {
cursor: pointer;
font-size: 0.9em;
position: fixed;
text-align: center;
z-index: 9999;
-webkit-transition: background-color 0.2s ease-in-out;
-moz-transition: background-color 0.2s ease-in-out;
-ms-transition: background-color 0.2s ease-in-out;
-o-transition: background-color 0.2s ease-in-out;
transition: background-color 0.2s ease-in-out;

background: $background_color;
color: $color;
border-radius: {$border_radius}px;
padding-left: {$padding_x}px;
padding-right: {$padding_x}px;
padding-top: {$padding_y}px;
padding-bottom: {$padding_y}px;
$position_css
}

#scrollToTop @media (max-width: 767px) {
display: none;
}

#scrollToTop:hover {
background: $hover_background_color;
color: $hover_color;
}

#scrollToTop > img {
display: block;
margin: 0 auto;
}
CSS;

$document->addStyleDeclaration($css);

if ($custom_css) {
$document->addStyleDeclaration($custom_css);
}

if ($engine != 'jquery') {
JHtml::_('behavior.framework', true);
JHtml::_('script', 'plg_system_sl_scrolltotop/scrolltotop_mt.js', false, true, false, false, true);

$js = <<<SCRIPTHERE
document.addEvent('domready', function() {
new Skyline_ScrollToTop({
'image': '$image',
'text': '$text',
'title': '$title',
'className': '$class',
'duration': $duration,
'transition': $transition
});
});
SCRIPTHERE;
} else {
JHtml::_('jquery.framework');
JHtml::_('script', 'plg_system_sl_scrolltotop/scrolltotop_jq.js', false, true, false, false, true);

$js = <<<SCRIPTHERE
jQuery(document).ready(function() {
jQuery(document.body).SLScrollToTop({
'image': '$image',
'text': '$text',
'title': '$title',
'className': '$class',
'duration': $duration
});
});
SCRIPTHERE;
}

$document->addScriptDeclaration($js);
}
}
« Последнее редактирование: 02.04.2018, 14:20:45 от ppb25 »
*

Roinmana

  • Захожу иногда
  • 108
  • 2 / 0
Приветствую! В вашем коде в разделе CSS строка скрывающая кнопку на мобильных гаджетах:
Код
#scrollToTop @media (max-width: 767px) {
display: none;
}
Проверьте работает ли это свойство и ширину нужную подберите.
« Последнее редактирование: 02.04.2018, 14:28:28 от Roinmana »
*

ppb25

  • Захожу иногда
  • 54
  • 0 / 0
Приветствую! В вашем коде в разделе CSS строка скрывающая кнопку на мобильных гаджетах:
Код
#scrollToTop @media (max-width: 767px) {
display: none;
}
Проверьте работает ли это свойство и ширину нужную подберите.
Да, это я прописал, НО, к сожалению, этот вариант не сработал(((
*

wishlight

  • Живу я здесь
  • 4980
  • 293 / 1
  • от 150 руб быстрый хостинг без блокировок
Код
@media screen and (max-width: 767px){#scrollToTop {display: none !important;}}

Так тоже не работает?
UPD
Меня чуть-чуть обогнали,но с некоторых пор не могу удалить свой пост.
*

ppb25

  • Захожу иногда
  • 54
  • 0 / 0
Ребят, вы красавцы. Все работает. Спасибо большое
« Последнее редактирование: 02.04.2018, 20:11:57 от ppb25 »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Содержимое над меню off canvas на мобильном устройстве

Автор tyllyp

Ответов: 1
Просмотров: 1155
Последний ответ 13.08.2023, 00:19:56
от R31rus
Скрыть не нужные поля в SP LMS - Joomla Learning Management System

Автор kot488

Ответов: 0
Просмотров: 317
Последний ответ 23.01.2022, 17:19:38
от kot488
Как скрыть статью ссылающуюся на саму себя в модуле последних материалов?

Автор R31rus

Ответов: 9
Просмотров: 529
Последний ответ 18.11.2021, 12:50:05
от R31rus
Не работает slcallback на мобильном

Автор AlexeyKD

Ответов: 0
Просмотров: 332
Последний ответ 21.09.2021, 10:47:06
от AlexeyKD
Скрыть часть вкладок в расширении Slideshow CK

Автор ornix

Ответов: 0
Просмотров: 467
Последний ответ 17.05.2021, 16:38:00
от ornix