Skip to content

Instantly share code, notes, and snippets.

View charigor's full-sized avatar

GOSHA charigor

View GitHub Profile
//html
<div class="bx-content">
<h1>Каким способом можно обрезать текст с троеточием в конце?</h1>
<div class="news-content">Добрый день! Интересует вопрос как можно обрезать текст, чтобы в конце всегда было троеточие. Вариант с подставлением туда рисунка с градиентным фоном не выход. CSS свойство {text-overflow: ellipsis} тоже не помогает, так как оно работает с одной строчкой, у меня же блок с текстом на 5-6 строк. Посоветуйте по возможности более-менее детальную инфу как это сделать. Спасибо за ответ.</div>
<a href="https://toster.ru/q/200977?e=1710511">https://toster.ru/q/200977?e=1710511</a>
</div>
//js
var size = 120,
newsContent= $('.news-content'),
newsText = newsContent.text();
html//
<circle data-toll="SVG/CSS Tip" class="tool "r="25" cx="50" cy="50" fill="red"/>
<g class="tooltip css" transform="translate(50,50)">
<text text-anchor="middle" fill="red">
</text>
</g>
</svg>
css//
.tooltip {
pointer-events:none; /*let mouse events pass through*/
<!html>
<div class="dropdown-wrapper">
<div class="ae-dropdown dropdown">
<div class="ae-select">
<span class="ae-select-content"></span>
<i class="material-icons down-icon">keyboard_arrow_down</i>
</div>
<ul class="dropdown-menu ae-hide">
<li class='selected'><a>Dr</a></li>
<li><a>Mr</a></li>
//product gallery html
<div class="product-picture">
<div class="main-picture">
<img src="img/product1.png" alt="">
</div>
<div class="pictures-wrapper">
<div class="gallery-item active">
<img src="img/product1.png" alt="#">
</div>
<div class="gallery-item">
<!--html -->
<ul> <li><a>Some tags</a></li></ul>
/* css*/
ul{list-style: none;
-webkit-columns: 200px 7;
-moz-columns: 200px 7;
columns: 200px 7;
-webkit-column-gap: 0;
-moz-column-gap: 0;
column-gap: 0;
@charigor
charigor / Untitled-1
Created June 26, 2018 05:11
scrollTop arrow
var $btnTop = $("my-btn");
$(window).on("scroll",function(){
if ($(window).scrollTop() >=20){
$btnTop.fade();
}else{
$btnTop.fadeOut();
}
});
$btnTop.on('click',function(){
@charigor
charigor / _content.scss
Created June 25, 2018 20:07
magnific popup scrolling mbile
body {
-webkit-overflow-scrolling: touch;
}
body.mfp-zoom-out-cur {
overflow: hidden;
-webkit-overflow-scrolling: auto;
}
.mfp-wrap {
//HTML
<script src="https://maps.googleapis.com/maps/api/js?v=3&key="></script>
//JS
function initMap() {
var coordinates = {lat: -37.806006, lng: 144.961291}, // Координаты центра карты
markerImg = 'img/marker.png', // Иконка для маркера
// создаем карту и настраеваем
map = new google.maps.Map(document.getElementById('map'), {
center: coordinates,
@charigor
charigor / _content.scss
Created May 9, 2018 15:29
6ти угольник на css
//////////////////////////////////Html
<div class="wr">
<a href="#" class="item">
<div class="item__content">
<div class="elem1">
</div>
<div class="elem2">
</div>
</div>
@charigor
charigor / common.js
Created April 11, 2018 10:51
smooth page appearance
<script type="text/javascript">
$(document).ready(function(){
var body = $("body");
body.fadeIn(400);
$(document).on("click", "a:not([href^='#']):not([href^='tel']):not([href^='mailto'])", function(e) {
e.preventDefault();
$("body").fadeOut(400);
var self = this;
setTimeout(function () {
window.location.href = $(self).attr("href");