~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to media/js/scripts.js

  • Committer: Holger Rapp
  • Date: 2012-03-17 16:22:06 UTC
  • Revision ID: sirver@gmx.de-20120317162206-fgttamk22qt1nytj
Let post count be calculated automatically instead of keeping track of it manually. Let's see how this affects performance

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
$(document).ready(function() { 
2
 
        $('[placeholder]').focus(function() {
3
 
                var input = $(this);
4
 
                if (input.val() == input.attr('placeholder')) {
5
 
                        input.val('');
6
 
                        input.removeClass('placeholder');
7
 
                }
8
 
        }).blur(function() {
9
 
        var input = $(this);
10
 
                if (input.val() == '' || input.val() == input.attr('placeholder')) {
11
 
                        input.addClass('placeholder');
12
 
                        input.val(input.attr('placeholder'));
13
 
                }
14
 
        }).blur();
15
 
});