Skip to content

Instantly share code, notes, and snippets.

$(".tab_item").not(":first").hide();
$(".wrapper .tab").show().click(function() {
var ind = $(this).index();
$(".wrapper .tab").removeClass("active").eq(ind).addClass("active");
$(".tab_item").hide().eq(ind).fadeIn()
}).eq(0).addClass("active");
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
@agragregra
agragregra / webvisor.js
Last active February 8, 2018 14:17
Open All Webvisor Items
// Open All Webvisor Items
var time = 1000;
$(".toggle-expand").each(function() {
var ths = $(this);
setTimeout(function() {
ths.click();
}, time);
time += 1000;
});
@agragregra
agragregra / fonts.js
Created April 26, 2015 23:42
WebFonts LocalStorage HTML5
<script id="webfont-localstorage-js">!function(){function e(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e){return window.localStorage&&localStorage.font_css_cache&&localStorage.font_css_cache_file===e}function n(){if(window.localStorage&&window.XMLHttpRequest)if(t(o))a(localStorage.font_css_cache);else{var n=new XMLHttpRequest;n.open("GET",o,!0),e(n,"load",function(){4===n.readyState&&(a(n.responseText),localStorage.font_css_cache=n.responseText,localStorage.font_css_cache_file=o)}),n.send()}else{var c=document.createElement("link");c.href=o,c.rel="stylesheet",c.type="text/css",document.getElementsByTagName("head")[0].appendChild(c),document.cookie="font_css_cache"}}function a(e){var t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}var o="css/fonts.css";window.localStorage&&localStorage.font_css_cache||document.cookie.indexOf("font_css_cache")>-1?n():e(window,"load",n)}();</script>
<?php
wp_reset_query();
global $withcomments;
$withcomments = 1;
comments_template( '', true );
@agragregra
agragregra / jQuery.newPlugin.js
Created December 19, 2015 08:12
jQuery New Plugin
$.fn.myNewPlugin = function() {
return this.each(function() {
// Do something to each element here.
});
};
@agragregra
agragregra / .htaccess
Created October 10, 2016 10:46
htaccess index.html & www redirect
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} www.placeburg.com [NC]
RewriteRule (.*) http://placeburg.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(htm(l)?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index\.(htm(l)?|php)$ http://placeburg\.com/$1 [R=301,L]
{{ post.content | strip_html | truncatewords: 28 }}
@agragregra
agragregra / jekyll-category post-list.html
Created October 10, 2016 10:27
Jekyll Category Post List
{% for post in site.categories.[page.category] limit: 8 %}
{% include photo-item.html %}
{% endfor %}
@agragregra
agragregra / jekyll-post-naxt-prev-navigation.rb
Created October 10, 2016 10:08
Jekyll Post Navigation (Prev & Next Posts)
module Jekyll
class WithinCategoryPostNavigation < Generator
def generate(site)
site.categories.each_pair do |category, posts|
posts.sort! { |a,b| b <=> a}
posts.each do |post|
index = posts.index post
next_in_category = nil
previous_in_category = nil
if index
@agragregra
agragregra / svgdraw.js
Created September 15, 2015 04:39
SVG Animate
var path = document.querySelector('path');
var length = path.getTotalLength();
// Clear any previous transition
path.style.transition = path.style.WebkitTransition =
'none';
// Set up the starting positions
path.style.strokeDasharray = length + ' ' + length;
path.style.strokeDashoffset = length;
// Trigger a layout so styles are calculated & the browser
// picks up the starting position before animating