Steamed Design

  • Random
  • Archive
  • RSS
  • Ask me anything

Easter eggs jQuery plugin

I decided that a project I was working in needed more monsters so I created a quick jQuery plugin to add them, have fun.

//Change image
//<div data-swapcss-value='url("imageurl.png")'>

//Full options
//<div data-swapcss-property='background-color' data-swapcss-value='red'  data-swapcss-count="3">
var swapCssConfig = {}
var swapCssConfig.currentCount = 0;
(function ($) {
    $.fn.swapCSS = function (options) {

        var settings = jQuery.extend({
            clickCount: 6,
            property: 'background-image'
        }, options);

        var currentElement = this;

        currentElement.click(function () {
            warningClickCount++;
            if (swapCssConfig.currentCount > (settings.clickCount - 1)) {
                currentElement.css(settings.property, settings.value);
                currentElement.unbind('click');
            }
        });
    };

    $(document).ready(function () {
        $('[data-swapcss-value]').each(function (index) {
            var item = $(this);
            var options = { value: item.attr('data-swapcss-value') };

            if (item.attr('data-swapcss-count') !== undefined)
                options.clickCount = item.attr('data-swapcss-count');   

            if (item.attr('data-swapcss-property') !== undefined)
                options.property = item.attr('data-swapcss-property');

            item.swapCSS(options);
        });
    });

})(jQuery);
    • #javascript
    • #jquery
    • #fun
    • #free
  • 1 year ago
  • 9
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

The perils of message placement

Today I entered a contest to win a windows phone I filled in the form and clicked send the form cleared and nothing happerned, or so I thought.

Where Is it?

I scrolled down a little and there was a success message, It goes to show if you place a ajax message in the wrong place it can lead to confusion. If the message was above the submit button it would of been fine.

Oh there it is.

    • #development
  • 1 year ago
  • 16
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Shrinking Twitter Bootstrap

I really like the Twitter bootstrap but there is one small problem the css file has a bunch of styles that I never used and is slowing down the page load.

Luckly the the people at twitter use less so its pretty easy to customise the css to only include what you want.

For my new iPad Kids game site I wanted to use the reset and the layout and nothing else. To do this:

  1. Download the source from github.
  2. Open lib/bootstrap.less
  3. Comment out the stuff you don’t want (see below)
  4. Then Compress (I use less.app because I am lazy but the command line app works too).

Reset and Layout Only

// CSS Reset
@import "reset.less";

// Core variables and mixins
@import "variables.less"; // Modify this for custom     colors, font-sizes, etc
@import "mixins.less";

// Grid system and page structure
@import "scaffolding.less";

// Styled patterns and elements
//@import "type.less";
//@import "forms.less";
//@import "tables.less";
//@import "patterns.less";
  • 1 year ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

My Typography Cheat Sheet

I know very little about web design and typography in fact most it is from one presentation, so here is my typography cheat sheet.

My Typography Cheat Sheet

  • Line height of 1.3-2.0 ems
  • Column width: 2 alphabets
  • Body text: 16px
  • 2-3 typefaces, maximum
  • Sans-serif (ex. Helvetica) for titles
  • Serif (ex. Georgia) for body text

Some Links

  • Typography for Lawyers
  • Web Typography
  • Designing for the Web
    • #web
    • #development
    • #css
  • 1 year ago
  • 72
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
It good when other people get bugs through to production too.
Pop-upView Separately

It good when other people get bugs through to production too.

  • 1 year ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 2 of 12
← Newer • Older →

About

Avatar Thoughts and work form a software developer in his attempts to learn some new stuff.

Pages

  • Example Code
  • Photo's from my Phone
  • Alpine Parrot
  • PSN
  • Careers 2.0
  • Old Blog

Me, Elsewhere

  • Korich on Forrst
  • @korich on Twitter
  • Facebook Profile
  • Linkedin Profile
  • korich on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union