Skip to content

Instantly share code, notes, and snippets.

View Tsunamijaan's full-sized avatar

Tariqul Islam Tsunamijaan

  • Coder Team IT
  • Rajshahi, Bangladesh
View GitHub Profile
=======preloader-html-start-here========
<!-- ===preloader=== -->
<div class="preloader">
<div class="preloader-image">
<div class="preloader-inner">
<img src="img/preloader.gif"/>
</div>
</div>
</div>
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
/*!
* Scrollspy Plugin
* Author: r3plica
* Licensed under the MIT license
*/
; (function ($, window, document, undefined) {
// Add our plugin to fn
$.fn.extend({
//===========Smmoth-scrol-jquirey=========
$(".smooth a").bind('click', function (event) {
$(this).parent().addClass('active').siblings().removeClass('active');
var $anchor = $(this);
var headerH = '0';
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top - headerH + "px"
}, 1000, 'easeOutExpo');
<div class="main-menu text-right">
<div class="mobile-menu"></div>
<nav class="one-page-nav"
id="mobile-menu-active">
<ul id="brandi">
<li class="smooth active"><a href="#home">Home</a></li>
<li class="smooth"><a href="#about">about</a></li>
<li class="smooth"><a href="#portfolio">Portfolio</a></li>
<li class="smooth"><a href="#services">Services</a></li>
<li class="smooth"><a href="#blog">Blog</a>
/*
* Inspired by:
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed
@Tsunamijaan
Tsunamijaan / GravityForm autopopulate dropdown from post
Created December 29, 2018 07:05
GravityForm autopopulate dropdown from post
<?php
add_filter( 'gform_pre_render_1', 'autopopulate_class' );
add_filter( 'gform_pre_validation_1', 'autopopulate_class' );
add_filter( 'gform_pre_submission_filter_1', 'autopopulate_class' );
add_filter( 'gform_admin_pre_render_1', 'autopopulate_class' );
function autopopulate_class( $form ) {
foreach ( $form['fields'] as &$field ) {
if ( $field->type != 'select' || strpos( $field->cssClass, 'populate-events' ) === false ) {
RewriteEngine on
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
@Tsunamijaan
Tsunamijaan / Limit excerpt
Last active December 29, 2018 07:08
Limit excerpt
<?php
function limit_words($string, $word_limit) {
$words = explode(' ', $string);
return implode(' ', array_slice($words, 0, $word_limit));
}
================Usages================
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
========Redirect an entire site====
This way does it with links intact. That is www.oldsite.com/some/crazy/link.html will become www.newsite.com/some/crazy/link.html. This is extremely helpful when you are just “moving” a site to a new domain. Place this on the OLD site:
Redirect 301 / http://newsite.com/