Mouse over Info on fields
Posted by mkhairul - May 22, 2008 at 12:05:10 am -Categories: Development, blog
I'm creating a simple web app similar to del.icio.us but focuses more on a specific task. One of the features that I put in is the mouse over on a field will reveal an info (not tooltip). Not as nice as Wufoo though.
This stuff is used with jQuery 1.2.3 and in the screenshot of the mouse over info I used Blueprint CSS Framework.
Here is a screenshot of the web application.
Few lines of javascript...
JAVASCRIPT:
-
$(document).ready(function(){
-
$('input').each(function(){
-
var name = $(this).attr('name');
-
$(this).bind('mouseenter mouseleave', function(){
-
$('.init').toggle();
-
$('#info_' + name).toggle();
-
})
-
});
-
})
Few lines of html...
HTML:
-
<fieldset style="padding: 5px; float: left; width: 300px; margin-right: 10px;">
-
<legend>Info</legend>
-
<label>Name</label>
-
<br />
-
<input type="text" name="name" />
-
</p>
-
<label>Email</label>
-
<br />
-
<input type="text" name="email" />
-
</p>
-
</fieldset>
-
<fieldset style="padding: 5px; float: left; width: 200px;">
-
<legend>More Info!</legend>
-
<div class="info init">
-
This is where the information box!
-
</div>
-
<div id="info_name" class="info">
-
Put your name in now!
-
</div>
-
<div id="info_email" class="info">
-
Put your real email in now!
-
</div>
-
</fieldset>
And a few lines of CSS
CSS:
-
.info{ display: none; }
-
.init{ display: block; }
You can see the example here.
May 22, 2008 | In Development, blog |
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds.
Valid XHTML and CSS.


