Responsive website with Matchmedia

Media queries is a great tool, but we often got a problem on loading time and optimization. Often time our website load all the things – even when they don’t apply.

Scott Jehl, Paul Irish, Nicholas Zaka attempts to optimise the loading of CSS based on viewport size and other factors. By using matchMedia() polyfill, we can now test whether a CSS media type or media query applies. Check out Paul Rhayes how to’s, experiment and Christian Hielmann Demo.

Your CSS

.mq {
  -webkit-transition: width 0.001ms;
  -moz-transition: width 0.001ms;
  -o-transition: width 0.001ms;
  transition: width 0.001ms;
  width: 0;
}

Javascript Event Listener

mql = (function(doc, undefined){

  var bool,
      docElem  = doc.documentElement,
      refNode  = docElem.firstElementChild || docElem.firstChild,
      idCounter = 0;

  return function(q, cb) {

    var id = 'mql-' + idCounter++,
      callback = function() {
        cb({ matches: (div.offsetWidth == 42), media: q });
      },
      div = doc.createElement('div');

    div.className = 'mq';
    div.style.cssText = "position:absolute;top:-100em";
    div.id = id;
    div.innerHTML = ' #'+id+' { width: 42px; }';

    div.addEventListener('webkitTransitionEnd', callback, false);
    div.addEventListener('transitionend', callback, false); //Firefox
    div.addEventListener('oTransitionEnd', callback, false); //Opera

    docElem.insertBefore(div, refNode);
    //don’t delete the div, we need to listen to events
    return {
      matches: div.offsetWidth == 42,
      media: q
    };
  };

})(document);

Javascript on the page

$(function() {
  var $dynamic = $('.dynamic');
  mql('all and (max-width: 700px)', change);
  mql('all and (max-width: 500px)', change);
  mql('all and (min-width: 1200px)', change);

  function change(mql) {
    console.log(mql);
    $dynamic.prepend('

' + mql.media + ' — ' + mql.matches + '

'); } });

How to create your own Jquery Modal

Basic modal need a simple and easy code, sometimes it’s more appropriate to create your own than a full featured modal or lightbox plugin. This are guide to have an Instant Modal or you can check out the result here »

HTML

<div id="question"><h1>Question???</h1></div>
<div class="contactdet">
<div class="contactformfooter">
<div id="close">Close</div>
<h1>ANSWER</h1>
</div>

CSS

#question {cursor:pointer;}
.contactdet{display:none; background:#aaa; width:100%; height:100%; 
position:fixed; top:0; z-index:99999;}
.contactformfooter {width:240px; height:240px; position:relative; margin:10% auto 0 auto; padding:20px; border:1px #000 solid; background:#fff;}
.contactformfooter p{padding-bottom:10px; line-height:20px; font-size:12px;}
#close {width:50px; height:50px; position:absolute; right:-25px; top:-25px; cursor:pointer; background:#333; color:#fff;}

jQuery

jQuery( "#question" ).click(function() {
	jQuery(".contactdet").show();
});

jQuery( "#close" ).click(function() {
	jQuery(".contactdet").hide();
});	

Funky Blueman

Blueman

Blue Man Group is a creative organization founded by Phil Stanton, Chris Wink and Matt Goldman. The organization produces theatrical shows and concerts featuring music, comedy and multimedia; recorded music and scores for film and television; television appearances for shows such as The Tonight Show, Scrubs, FETCH! with Ruff Ruffman, and Arrested Development; and a children’s museum exhibit (“Making Waves”). All of the organization’s appearances star a trio of performers called Blue Men.

I was inspired by the Vegas Blueman when I designed this template.

Download of Blue Man Materials and CSS Template.

Free Church Website

Build your church or ministry website with ease and at no cost. This free Church Web Site for Christian churches of any denomination who need a first class web site. Include an inner web-page template so you can create a web pages as many subjects you feel are necessary to help spread the good word and communicate with your congregation.
Highest Praise

Hills Ville

HillsVille are located in Carroll County in the beautiful and majestic Blue Ridge Mountains of Virginia.

Golden FLower

Southwestern Virginia is truly a four-season destination with the geography and climate to match every outdoor activity, adventure and sport, whether it’s of the high-adrenaline or laid-back variety. Many outdoor attractions offer hiking, cycling, fishing, hunting and camping. Explore state parks such as Claytor Lake, Fairy Stone, Grayson Highlands and New River Trail. In addition, visitors to Jefferson National Forest can enjoy birding, horseback riding, skiing and more.