Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Created September 30, 2011 09:04
Show Gist options
  • Select an option

  • Save hkulekci/1253172 to your computer and use it in GitHub Desktop.

Select an option

Save hkulekci/1253172 to your computer and use it in GitHub Desktop.
/*
* Usage
*
* $('#textarea_id').tweet_text_design("First part | Second Part");
*
*
*/
$.fn.tweet_text_design = (function(text){
text = text.split("|");
this.attr("title",text[0]+sozluksettings.query_string_for_js+text[1]);
this.val(text[0]+sozluksettings.query_string_for_js+text[1]);
this.css({"color":"#999999"});
this.focus(function(){
if ($(this).val() == $(this).attr("title") || $(this).val().trim() == ""){
$(this).val(sozluksettings.query_string_for_js);
$(this).css({"color":"#777777"});
}
}).blur(function(){
if ( $(this).val().trim() == "" ){
$(this).val($(this).attr("title"));
$(this).css({"color":"#999999"});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment