Skip to content

Instantly share code, notes, and snippets.

@zaurmag
zaurmag / ajax-magnific-popap.js
Created August 7, 2016 18:19
Ajax Magnific Popap
// ======= Ajax - Magnific Popap =======
$('.simple-ajax-popup').magnificPopup({
type: 'ajax',
tLoading: '<img src="/components/com_jshopping/images/cartajax-loading.gif" />',
closeOnContentClick: false,
showCloseBtn: false
});
@zaurmag
zaurmag / animate-anchor.js
Last active August 7, 2016 18:29
Плавный скроллинг до блока
// ======= Animate Anchor =======
$(".arrow-go-down").click(function() {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top + "px"
}, {
duration: 500
});
return false;
});
@zaurmag
zaurmag / scroll-spy.js
Last active August 7, 2016 18:27
Выделение пункта меню Skroll Spy
// ======= Scroll Spy Menu =======
var lastId,
topMenu = jQuery("#main-menu"),
topMenuHeight = topMenu.outerHeight(),
menuItems = topMenu.find("a"),
scrollItems = menuItems.map(function() {
var item = jQuery(jQuery(this).attr("href"));
if (item.length) {
return item;
@zaurmag
zaurmag / enquireJs.js
Last active August 7, 2016 18:31
Enquire JS
// ======= Enquire JS =======
enquire.register("screen and (max-width:1170px)", {
match: function() {
$('.menu-nav-wrapper').dropdownMenu();
},
unmatch: function() {
$('.menu-nav-wrapper').dropdownMenu({
destroy: true
});
@zaurmag
zaurmag / col-height.js
Created August 7, 2016 18:22
Одинаковая высота колонок
// ======= Одинаковая высота колонок =======
var max_col_height = 0;
$('.list_product .block_product').each(function() {
if ($(this).height() > max_col_height) {
max_col_height = $(this).height();
}
});
$('.list_product .block_product').height(max_col_height);
// Close Alert
@zaurmag
zaurmag / responsive-video.css
Created August 7, 2016 18:37
Адаптивное видео Youtube
########################################## Адаптивное видео Youtube
.myvideo {
position:relative;
padding-bottom:56.25%;
padding-top:30px;
height:0;
overflow:hidden;
border:1px solid #ccc;
}
@zaurmag
zaurmag / is-home.php
Created August 12, 2016 07:28
Условие на главной - Joomla
//Условие - на главной или нет
if (JURI::current() == JURI::base()) {echo "делать то то на главной"};
@zaurmag
zaurmag / view-module-teml-joomla.php
Created August 14, 2016 09:36
Вывод модулей в шаблоне Joomla
<?php //вывод позиции модулей
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$options = array('style' => 'xhtml');
$position = 'user1';
echo $renderer->render($position, $options, null);
?>
<!-- или -->
@zaurmag
zaurmag / ie-browser.css
Created August 17, 2016 22:00
Стили для браузера ИЕ
@media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {
#page {
display: block;
}
.item-title {
font-size: 24px;
}
}
@zaurmag
zaurmag / mask-input.js
Last active November 18, 2017 10:01
Маска телефона
// ======= Input Field Mask =======
$(".telMask").inputMask("+7 (999) 999-99-99");