$(document).ready(function(){
$('.language .head').click(function() {
$(this).closest('.language').find('ul').stop().slideToggle();
});
});
<div class="language">
<span class="head">Ru</span>
<ul>
<li><a href="http://exemple.com/">Ru</a></li>
<li><a href="http://exemple.com/en/">En</a></li>
</ul>
</div>
.language {
display: inline-block;
position: relative;
}
content: '';
width: 0;
height: 0;
border: 5px solid transparent;
border-top-color: transparent;
border-top-style: solid;
border-top-width: 5px;
border-bottom-color: transparent;
border-bottom-style: solid;
border-bottom-width: 5px;
border-bottom: none;
border-top: 5px solid #FFF;
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
}
.language .head {
padding: 5px 25px 5px 15px;
color: #FFF;
background: #000;
}
.language ul {
list-style-type: none;
padding: 0;
margin: 0;
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
background: #000;
}
.language ul li a {
display: block;
color: #FFF;
padding: 5px 15px;
}
<?
if (CModule::IncludeModule("iblock")):
$iblock_id = 53;
# show url my elements
$my_elements = CIBlockElement::GetList (
Array("ID" => "ASC"),
Array("IBLOCK_ID" => $iblock_id),
false,
false,
Array('ID', 'NAME', 'PROPERTY_TAGS', 'DETAIL_PAGE_URL')
);
while($ar_fields = $my_elements->GetNext())
{
echo $ar_fields['NAME'])." ;<br>";
}
endif;
?>
<script>
var $my_elements = <?=json_encode($my_elements);?>
</script>
$('[href*="path=94"]').each(function() {
$(this)
.attr('href', 'http://m.me/')
.closest('product-thumb').find('.cart').append('<div>111111111111</div>')
})
<div id='main'>div1</div>
<div>div2
<div>div21</div>
<div><span>div22</span></div>
<i>div23</i>
</div>
#main + div * { ... }
if (window.pageYOffset < headerBottom) {
header.classList.remove('sticky');
flag = true;
} else if (window.pageYOffset > headerBottom && flag) {
header.classList.add('sticky');
fade(header, 2000, 50);
flag = false;
}
position: sticky
$('.submenu-pop-right span').click(function() {
$(this).closest('li').find('.submenu').show(); $(this).closest('li').siblings().find('.submenu').hide();
});