Monday, December 10, 2012

image sprites collection







Wednesday, August 29, 2012

wireframe vs mock-up vs prototype

Nice and small presentation on slideshare about the key idea of those concepts and their order during UI development: http://www.slideshare.net/voutulny/wireframe-vs-mockup-why-and-when

Thursday, August 23, 2012

document. Object properties


document.documentElement
References the root element of the document, in the case of HTML documents, the html element. This read only property is useful for accessing all elements on the page, such as the HEAD.

document.compatMode
The two possible values returned are "BackCompat" for Quirks and "CSS1Compat" for Strict.

document.documentMode 
IE8 only property


document.readyState
IE property. Supported in Opera 9+, Chrome, and FF 3.6+ as well.

Returns the loading status of the document. It returns one of the below 4 values:
 
uninitializedThe document hasn't started loading yet.
loadingThe document is loading.
interactiveThe document has loaded enough whereby user can interact with it.
completeThe document has fully loaded.

See also:
Defining Document Compatibility : http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

Saturday, August 18, 2012

blinking loader with javascript

Recently saw a pretty simple ajax-loading image on workopolis.com. It's shown to visitors below the article text while comments are loading. For example you can see it in this article.


Here it is a easy gif file: 

So i decided to do the same with only html and javascript. 
And here is a JSFiddle - http://jsfiddle.net/a7bkU/44/

Actually the parameter in setTimeout call in drawLoader function is a bit tricky - one should play with it a little to customize it to fit a number of blinking circles. In other words, it must be small enough not to make all circles blink at the same time.

HTML
<div class="loading"></div>

CSS
.load-circle {
    padding:8px;
    background:#666;
    border-radius10px;
    display:inline-block;
    margin:5px;
}
.loading {
 margin:10px;
 padding:10 20px;
}

JS
drawLoader(3$('.loading'));

function drawLoader(nelement{
    //draw loading circles
    for (i=0i<ni++{
        $(element).append('<div class="load-circle" />');
    }
    //for each start a blink action with apropriate time lag
    $.each(jQuery('.load-circle')function(indexitem){
        setTimeout(function(){
            blinker.call(itemtrue);    
        }index*400);
    });
}

function blinker(dir){
    //needed for recursive calls
    //knowing in which direction
    if(dir{
        $(this).animate({opacity0.25}800function(){
            blinker.call($(this)!dir);
        })    
     else {
         $(this).animate({opacity1}800function(){
            blinker.call($(this)!dir);
        })     
     }
}

Thursday, August 9, 2012

ΠΊΠ°ΠΊ Π½Π°Π΄ΠΎ ΠΈ ΠΊΠ°ΠΊ Π½Π΅ Π½Π°Π΄ΠΎ ΠΏΠΈΡΠ°Ρ‚ΡŒ Π² jQuery

Π’ Ρ†Π΅Π»ΠΎΠΌ ΡΡ‚Π°Ρ‚ΡŒΡ для Π½Π°Ρ‡Π°Π»ΡŒΠ½ΠΎΠ³ΠΎ уровня, Π½ΠΎ ΠΈΠ·Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π±Π΅Π· Π½Π΅Ρ€Π²ΠΎΠ² ΠΈ понятноС.

ΠžΡ‚ΡΡŽΠ΄Π°: http://habrahabr.ru/post/149237/

1. ΠžΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΈ событий Π³Ρ€ΡƒΠΏΠΏ элСмСнтов

нСэкономично, Π½Π΅ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ
$('.comment a.delete').click(function(){ // });

ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ, ΠΌΠ΅Ρ‚ΠΎΠ΄ .on c jQuery 1.7
$('body').on('click', 'a.external', function(e) { // });

2. Ajax Π²Ρ‹Π·ΠΎΠ²Ρ‹

Π½Π΅ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ, ΠΏΡƒΡ‚Π°Π½ΠΈΡ†Π°
$.post(url, data, function(data) { // }, 'json').error(function() { /// });

Π²Π°Ρ€ΠΈΠ°Π½Ρ‚ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ с ΠΎΠ±Ρ‰ΠΈΠΌ ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΎΠΌ ошибок
$.ajaxSetup({ error: function() { // } });

Ρ‡ΠΈΡ‚Π°Π΅ΠΌΡ‹ΠΉ ΠΈ понятный Π²Π°Ρ€ΠΈΠ°Π½Ρ‚
$.ajax({ type: "POST" url: url, data: data, dataType: "json", success: function(data) { // }, error: function() { // } })

3. Namespaced events - Ссли Π½ΡƒΠΆΠ½ΠΎ нСзависимо Π΄ΠΎΠ±Π°Π²Π»ΡΡ‚ΡŒ ΠΈ ΡƒΠ΄Π°Π»ΡΡ‚ΡŒ ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΈ Π½Π° ΠΎΠ΄ΠΈΠ½ ΠΈ Ρ‚ΠΎΡ‚ ΠΆΠ΅ элСмСнтhttp://docs.jquery.com/Namespaced_Events