Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added pure-css placeholder recipe #44

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion _posts/2009-01-01-ajax-inplaceeditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,21 @@ <h3>In-Place edits only by externalControl</h3>
}
</code></pre>
<p>maybe someone can add a flag like ‘only <span style="color:#aaa"> External Control </span><a href="http://github.com/madrobby/scriptaculous/wikis/new?title=+External+Control+’">?</a> to add this to the trunk ..</p>
<h2>Pure CSS way to add placeholder text to an empty editable text item:</h2>
<pre>
<div class="editable"></div>
<style>
.editable:empty {
position: relative;
min-height: 1em;
}
.editable:empty:after {
content: 'Click to edit';
position: absolute;
color: #bbb;
}
</style
</pre>
<h2>Small extension to editor to add a text in case field is empty.</h2>
<pre><code class="javascript">
/*
Expand Down Expand Up @@ -636,4 +651,4 @@ <h2 style="vertical-align:middle;">Validation.</h2>
return false;
},
</code></pre>
</div>
</div>