Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript">
jQuery(document).ready(function ($) {
$('.product_grid_item:nth-child(19)').after('<div class="mid-header" id="hp1" ><div id="votk"><p>1</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
$('.product_grid_item:nth-child(40)').after('<div class="mid-header" id="hp2" ><div id="votk"><p>2</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
$('.product_grid_item:nth-child(61)').after('<div class="mid-header" id="hp3"><div id="votk"><p>3</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
$('.product_grid_item:nth-child(82)').after('<div class="mid-header" id="hp4"><div id="votk"><p>4</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
@malachi358
malachi358 / gist:6077473
Created July 25, 2013 07:05
CSS Fade In Animation
.fade-in {
animation: fadein 4s;
-moz-animation: fadein 4s; /* Firefox */
-webkit-animation: fadein 4s; /* Safari and Chrome */
-o-animation: fadein 4s; /* Opera */
}
@keyframes fadein {
from {
opacity:0;
}
@malachi358
malachi358 / gist:6077468
Created July 25, 2013 07:03
Remove Inline Styles with Jquery Plugin.
(function($)
{
$.fn.removeStyle = function(style)
{
var search = new RegExp(style + '[^;]+;?', 'g');
return this.each(function()
{
$(this).attr('style', function(i, style)
{
@malachi358
malachi358 / wp-page-css
Created July 15, 2013 07:26
Page Specific CSS for Wordpress
body.page-id-2821 {
}
@malachi358
malachi358 / PreloadIMGjQuery
Created June 24, 2013 10:08
Preloading images with jQuery
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
// Alternatively you could use:
// (new Image()).src = this;
});
}
// Usage:
@malachi358
malachi358 / gist:5655782
Last active December 17, 2015 18:49
CSS3 animate background color infinite loop :)
body, #logo h1 a, ul#menu li.on {background-color: #39f !important;}
@-webkit-keyframes colours {
0% {background-color: #39f;}
15% {background-color: #8bc5d1;}
30% {background-color: #f8cb4a;}
45% {background-color: #95b850;}
60% {background-color: #944893;}
75% {background-color: #c71f00;}
90% {background-color: #bdb280;}
100% {background-color: #39f;}
@malachi358
malachi358 / gist:5655495
Created May 27, 2013 06:39
center div with absolute property
<body>
<div style="position: absolute; left: 50%;">
<div style="position: relative; left: -50%; border: dotted red 1px;">
I am some centered shrink-to-fit content! <br />
tum te tum
</div>
</div>
</body>
@malachi358
malachi358 / gist:5650422
Created May 25, 2013 19:18
Call images from WP template directory(Your Theme).
<img src="<?php bloginfo('template_directory'); ?>/images/example.png"/>
@malachi358
malachi358 / gist:5609972
Created May 20, 2013 01:54
NON-CONFLICT READY JS IN WORDPRESS, BASICALLY TO USE IT “$” ESTABLISH THE JQUERY LIKE THIS AND THEN WORDPRESS WILL NORMALLY RUN THE JQUERY CODE.
jQuery(document).ready(function ($) {// ...You Code!...
});
@malachi358
malachi358 / gist:5609966
Created May 20, 2013 01:52
Animate a png onclick with a loop that fades in and out and stop it with onclick of another button.
<!--Html-->
<img src="l1.png" class="lights">
<a href="#" class="play">click me</a>
<a href="#" class="pause">Stop Lights</a>
<!--Jquery-->
<script type="text/javascript">