Pages

Saturday, July 23, 2016

Create Sticky Header on Scroll With jQuery and Cool CSS Transitions

On this post, i want to show you how to create a sticky header on scroll  using jQuery and CSS transitions. on the late post, i also write an example to create a dropdown menu with CSS transition. add sticky header become a favorite feature in this recent period. i also added sticky header on my site.

to create sticky header on scroll with jquery and cool css transitions you will need a little jQuery code like this:


add this code inside your <head></head> like this:

<head>
<script type="text/javascript">
jQuery(document).ready(function() {
 $(window).scroll(function() {
  var sticky = $('#header'),
   scroll = $(window).scrollTop();
  if (scroll > 50) sticky.addClass('fixed');
  else sticky.removeClass('fixed');
 });
});
</script>
</head>

and a jQuery Script should you put in the header, paste this on inside your <head></head> like this:

<head>
<!-- Your Code Before -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>

a full example:

<head>
<!-- Your Code Before -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
 $(window).scroll(function() {
  var sticky = $('#header'),
   scroll = $(window).scrollTop();
  if (scroll > 50) sticky.addClass('fixed');
  else sticky.removeClass('fixed');
 });
});
</script>
</head>

and paste this css to Create Sticky Header on Scroll With jQuery and Cool CSS Transitions on your css file:

/*----------------------------
     Sticky Header CSS
-----------------------------*/
#navbar{
  width:100%;
  height:45px;
  line-height:45px;
  background:#FFF;
 margin:0 auto;
}
#navbar a{
 text-decoration:none;
 color:#5AA628;
}
#navbar ul li{
  list-style:none;
  float:left;
  display:block;
  padding:0 15px;
}
#header{
 width:100%;
 line-height:35px;
 display:block;
 background:#01ACE2;
 margin:0 auto;
}
#header a{
 font-family:Arial, Helvetica, Serief;
 color:#FFF;
 font-size:14px;
 padding:0 15px;
 text-decoration:none;
}
.fixed#header{
 width:100%;
 position:fixed;
 top:0;
 left:0;
 background:#FFF;
 line-height:60px;
 border-top:4px solid #01ACE2;
 box-shadow:0px 1px 5px #999;
  transition:all 0.7s ease 0s;
 -webkit-transition:all 0.7s ease 0s;
 z-index:100;
}
.fixed#header a{
 color:#01ACE2;
 font-size:24px;
}


following is a HTML Code to Create Sticky Header on Scroll With jQuery and Cool CSS Transitions: 


<div id="main">
<div id="navbar">
<ul>
  <li><a href="#">Menu 1</a></li>
  <li><a href="#">Menu 2</a></li>
  <li><a href="#">Menu 3</a></li>
  <li><a href="#">Menu 4</a></li>
</ul>
</div>
<div id="header">
 <h1><a href="#">Home</a></h1>
</div>
</div>
Live Demo that i create on JS fiddle just like that, i hope this tutorial will help you to Create sticky header on scroll with jquery and cool css transitions. if you need help, you can leave a comment below.

An Easy Way to Create DropDown Navigation With CSS and Transition

Hi Reader, Thanks for visiting my blog. today i want to share how to create a dropdown navigation with CSS. first you need a HTML editor such us DreamWeaver, SublimeText or Notepad++. however, ussulaly i use SublimeText, because this software is lightweight on memory process. following are little snippet to Create dropdown menu navigation with css and css transition, no JavaScript needed but still nice transition effect with css only.

CSS for DropDown Navigation With CSS and Transition

#pagenav{
  width:100%;
  display:block;
  position:relative;
}
#pagenav li{
 float:left;
 display:block;
 position:relative;
 padding:10px 15px;
 font-weight:bold;
}
#pagenav li{
 background:#FFF;
}
#pagemenu li a{
 font-family:"Open Sans Condensed", Helvetica, Arial, sans-serif;
 color:#01ACE2;
 display:block;
 text-shadow:1px 1px 0 #FFF;
}
#pagenav li ul, #pagenav li ul li ul{
  width:150px;
  position:absolute;
  top:100%;
  left:0;
 opacity:0;
  padding:0;
 transform:translateZ(0);
 transform:translateY(10%);
 transition:all 0.5s ease 0s,visibility 0s linear 0.5s;
 -webkit-transition:all 0.5s ease 0s,visibility 0s linear 0.5s;
 visibility:hidden;
 z-index:100;
}
#pagenav li ul li ul{
  top:0;
  left:100%;
  opacity:0;
 transform:translateZ(0);
 transform:translateY(10%);
 transition:all 0.5s ease 0s,visibility 0s linear 0.5s;
 -webkit-transition:all 0.5s ease 0s,visibility 0s linear 0.5s;
 visibility:hidden;
 z-index:100;
}
#pagenav li:hover ul{
 opacity:1;
 transform:translateX(0%);
 transition-delay:0s;
 visibility:visible;
 display:block;
}
#pagenav li:hover ul li ul{
  opacity:0;
 transform:translateZ(0);
 transform:translateY(10%);
 transition:all 0.5s ease 0s,visibility 0s linear 0.5s;
 -webkit-transition:all 0.5s ease 0s,visibility 0s linear 0.5s;
 visibility:hidden;
 z-index:100;
}
#pagenav li ul li:hover ul{
 opacity:1;
 transform:translateX(0%);
 transition-delay:0s;
 visibility:visible;
 display:block;
}

an Example HTML to call DropDown Menu Navigation

<ul id="pagenav">
 <li>
  <a href="#">Menu 1</a>
  <ul>
   <li><a href="#">Menu 1a</a></li>
   <li><a href="#">Menu 1b</a></li>
   <li><a href="#">Menu 1c</a></li>
   <li>
    <a href="#">Menu 1d</a>
    <ul>
     <li><a href="#">Menu 1-2a</a></li>
     <li><a href="#">Menu 1-2b</a></li>
     <li><a href="#">Menu 1-3c</a></li>
     <li><a href="#">Menu 1-4d</a></li>
    </ul>
   </li>
  </ul>
 </li>
 <li>
  <a href="#">Menu 2</a>
  <ul>
   <li><a href="#">Menu 2a</a></li>
   <li><a href="#">Menu 2b</a></li>
   <li><a href="#">Menu 3c</a></li>
   <li><a href="#">Menu 4d</a></li>
  </ul>
 </li>
 <li><a href="#">Menu 3</a></li>
 <li><a href="#">Menu 4</a></li>
</ul>
Following is live Demo DropDown Navigation With CSS and Transition, that i create on JS Fiddle That is, a simple way to create a Drop-down menu navigation with CSS and CSS Transition

Friday, July 15, 2016

Soft Launching MattZine WP Themes

MattZine is comprehensive magazine theme for WordPress, create by myself (Matt Balung). i have spent five days and a few cups of coffee that made by my dearest wife to create this fantastic themes. :D

MattZine theme equipped with many features to make a great performance, designed with clean and lightweight code. has a lot of flat color choice with a tidy and modern appearance. (Responsive ready / Mobile Browser Support).

According to the plan, i will sell this MattZine WP Themes in three levels of packs.
  1. Starter Packs (Standard WP Features)
    • Suitable for Blogger Rajin dan ALIM :v
  2. Medium Pack (Build-in AGC Features [Without AutoPost and only Support 1 AGC Source], )
    • Suitable for: Blogger Kurang Rajin :v
  3. Addict Packs (Full Optimized Features, SEO, AD Filter, Visitor Filter, Build-in AGC [Autopost, Scheduled Post, Grab Image, YouTube Video, News etc..], Including Auto Generate Keyword for related content, Auto Generate Meta Tags and more)
    • Suitable for: Blogger Malas dan Pengen Hasil Banyak dan cepat hahahahahaha, like me :D :D

  Following the screenshot of MattZine WP Themes

MattZine WP Themes Screenshot by Matt Balung


General Features:

  • Clean, Flexible and Fully Responsive/Mobile Friendly Design
  • Powerful and Easy-to-use Theme Customizer
  • 100+ Google Webfonts
  • Search Engine Optimized (SEO)
  • Schema.org Supported
  • Custom Logo
  • Stylish Built-in Mega Menu
  • Post Formats (Standard, Audio, Video, Gallery)

MattZine WP Themes Features

  •  Responsive (Mobile Support)
  • 7+ Ads Spot (Top, Header Right, After Menu, Before/After Content, After ‘x’ Paragraph, Footer)
  • Various Archive Layouts (Standard, Grid, Masonry, Full Width Wide/Narrow, Left/Right Sidebar)
  • Custom Colors for Categories Header (used in Homepage)
  • Two types of Featured Style (Slider and Grid)
  • Various Color Skins (Green/Default, Red, Blue, Indigo, Cyan, and Magenta)
  • Various Container types (Full Width, Boxed, and Framed)
  • Stylish NewsTicker
  • Custom Page Templates (Homepage, Contact, and Teams)
  • Page Builder support (by SiteOrigin)
  • 12 Custom Widgets
http://mattzine.ga/

MattZine WP Themes