First, you’d put the image into your scene and give it a name, in this case “mainStage”. Then in the code: float worldScreenHeight = Camera.main.orthographicSize * 2;         float worldScreenWidth = worldScreenHeight / Screen.height * Screen.width;         mainStage … Continue reading

The other Outlooks look fine, but in 2013, when you try to make a short table/table cell it looks crap. The way to fix that is to set font-size to 1 and line-height to the height you want. <td height=”1″ … Continue reading

This code clears a text input field if it is the default text specified in the js. This can be used for things like search boxes or text fields in a form. To use it, add in the js: clearInput(“inputClass”,”defaultText”); … Continue reading

I really like the solution to making tables responsive by Zurb Studios. It only really works for tables where the first column is consistent but for those it works really well. Only problem is there is a bug at around … Continue reading

Toggle Buttons

Featured

To make a button toggle the visibility of things when clicked use: $(“.toggleBtn”).click(     function(event) {         event.preventDefault();         $(this).toggleClass(“current”);         var contentClass = $(this).attr(“href”).substring(1);         if (contentClass == “”) {             $(this).next().slideToggle();         } else {             $(“.” + … Continue reading

Sometimes this is required. To do this use:var winSize = window.outerWidth; if(winSize === undefined){             winSize = $(window).width();         }         console.log(winSize);         if (winSize > 480) {             // change style for non-mobile         } else {            … Continue reading

From http://stackoverflow.com/questions/1403615/use-jquery-to-hide-a-div-when-the-user-clicks-outside-of-it I used this for hiding a mobile navigation when tapping outside of it: $(document).mouseup(function (e) {     var container = $(“YOUR CONTAINER SELECTOR”);     if (!container.is(e.target) // if the target of the click isn’t the container…         && … Continue reading

A simple mixin that ensures you add focus styling along with your hovers: SASS: @mixin hoverFocus { &:hover, &:focus { @content; } } /* example */ .defaultBtn{ @include hoverFocus{ text-decoration: none; } }  which then outputs to: .defaultBtn:hover, .defaultBtn:focus {  text−decoration: none; }

To make a new custom page template, first make a new custom content type. Then copy page.tpl.php from the modules/system/ folder into your theme folder and rename it to page–[content type machine name].tpl.php ( Note: If your machine name has … Continue reading

To make a sub theme, add a new folder with the name of your theme in sites/all/themes/[themename] In that folder you need a text file called [themename].info. In it you need basic info like name = [name that’s displayed in … Continue reading