Commit 1e75f287 authored by fred's avatar fred

js

parent 538731af
......@@ -72,5 +72,35 @@ function mainmenu(){
}
<script type="text/javascript">
$("#recherche").attr("placeholder", "Rechercher");
function setupPlaceholder(inputid) {
if ($.browser.webkit) return false;
var target = $('#'+inputid);
if (target.length==0) {
target = $('input[type="text"], input[type="email"], input[type="search"]');
}
target.each( function(i, el) {
el = $(el);
var ph = el.attr('placeholder');
if (!ph) return true;
el.addClass('placeholder');
el.attr('value', ph);
el.focus( function(e) {
if( el.val()==ph ) {
el.removeClass('placeholder');
el.attr('value', '');
}
});
el.blur( function(e) {
if( $.trim(el.val())=='' ) {
el.addClass('placeholder');
el.attr('value', ph);
}
});
});
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment