Skip to content

Instantly share code, notes, and snippets.

View bulbul84's full-sized avatar

Md Bulbul Hasan bulbul84

View GitHub Profile
jQuery(document).ready(function($){
$(".all-portfolios").isotope({
itemSelector: '.single-portfolio',
layoutMode: 'fitRows',
});
$('ul.filter li').click(function(){
$("ul.filter li").removeClass("active");
$(this).addClass("active");
// Sticky Header
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$('.main_h').addClass('sticky');
} else {
$('.main_h').removeClass('sticky');
}
});
add_action( 'wp_enqueue_scripts', 'jk_masonry' );
function jk_masonry() {
wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) );
}
/*
How to use?
$('#container').masonry({ singleMode: true });
<?php
// in functions.php
add_theme_support( 'post-thumbnails');
/*
Wordpress crop an image = 5 size. Sizes are given below
thumbnail // Thumbnail (default 150px x 150px max)
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
// How to show loading-div after submitting a form with jQuery?
$('.formtrigger').click(function() {
$('#loading').show();
$('#form').submit();
});
/*When I click the button, the form is submitted, but the loading-div doesn't appear.
I tried the line "$('#loading').show();" without binding it on the click-event and it worked. I also tried this code: */
$('.formtrigger').click(function() {
alert('blablabla');
// Example One
<script>
setTimeout(function() {
document.body.style.background = 'red';
}, 3000);
window.onload = function() {
document.body.style.background = 'green';
};
$(document).ready(function () {
$(".navbar-toggle").on("click", function () {
$(this).toggleClass("active");
});
$("li.mega_drop_down").hover(function(){
$(".sf-mega").css('display', 'block');
}, function(){
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active smooth-scroll"><a href="#home">Home</a></li>
<li class="smooth-scroll"><a href="#about">About</a></li>
<li class="smooth-scroll"><a href="#igredients">Igredients</a></li>
<li class="smooth-scroll"><a href="#food-menu">Menu</a></li>
<li class="smooth-scroll"><a href="#reviews">Reviews</a></li>
<li class="smooth-scroll"><a href="#contact">Reservations</a></li>
</ul>
</div>