Skip to content

Instantly share code, notes, and snippets.

View yuriitaran's full-sized avatar

Yurii Taran yuriitaran

View GitHub Profile
<?php
$post = $wp_query->post;
if (in_category('cat_label_1')) {
include(TEMPLATEPATH.'/single-cat_label_1.php');
} elseif (in_category('cat_label_2')) {
include(TEMPLATEPATH.'/single-cat_label_2.php');
}
?>
$(".element").waypoint(function() {
$(this).addClass("animated zoomInUp");
}, {
offset: "70%"
});
.element:nth-child(1) {
-webkit-animation-delay: 0s;
-o-animation-delay: 0s;
animation-delay: 0s;
//Аякс отправка форм
//Документация: http://api.jquery.com/jquery.ajax/
$("#form, #form2").submit(function(e) {
e.preventDefault;
$.ajax({
type: "POST",
url: "mail.php",
data: $(this).serialize()
}).done(function() {
alert("Спасибо за заявку!");
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
<?php
$tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<p>Tag: <a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> </p> ';
}
}
?>
<?php
$tags = wp_get_post_tags($post->ID);
$(".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>
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
JS:
$(".accordeon dd").hide().prev().click(function() {
$(this).parents(".accordeon").find("dd").not(this).slideUp().prev().removeClass("active");
$(this).next().not(":visible").slideDown().prev().addClass("active");
});
CSS:
.accordeon .active { color: red }
HTML:
@yuriitaran
yuriitaran / animate-css.js
Created February 4, 2018 11:41 — forked from agragregra/animate-css.js
Animate CSS jQuery once animate
//Animate CSS + WayPoints javaScript Plugin
//Example: $(".element").animated("zoomInUp");
//Author URL: http://webdesign-master.ru
(function($) {
$.fn.animated = function(inEffect) {
$(this).css("opacity", "0").addClass("animated").waypoint(function(dir) {
if (dir === "down") {
$(this).addClass(inEffect).css("opacity", "1");
};
}, {
@yuriitaran
yuriitaran / stopdrag.js
Created February 4, 2018 11:40 — forked from agragregra/stopdrag.js
jQuery Stop Draggable Elements
$("img").on("dragstart", function(event) { event.preventDefault(); });