test/emission_fichiers/rollover.js
branchnew-model
changeset 882 61c384dda19e
parent 881 f11b234497f7
child 883 d35ad8111c5e
equal deleted inserted replaced
881:f11b234497f7 882:61c384dda19e
     1   $(document).ready(function(){  
       
     2     
       
     3 	    $('.rollover').hover(function(){
       
     4         if($(this).attr("src").indexOf("-hover") == -1) {
       
     5 			var newSrc = $(this).attr("src").replace(".png","-hover.png");
       
     6 			$(this).attr("src",newSrc);}},
       
     7 	function(){
       
     8             if($(this).attr("src").indexOf("-hover.png") != -1) {
       
     9 					var oldSrc = $(this).attr("src").replace("-hover.png",".png");
       
    10 					$(this).attr("src",oldSrc);}
       
    11                                         });
       
    12             
       
    13             $('input[type="text"]').addClass("idleField");  
       
    14             $('form:not([id="user-profile-form"]) input[type="text"]').focus(function() {
       
    15         $(this).removeClass("idleField").addClass("focusField");  
       
    16         if (this.value == this.defaultValue){  
       
    17             this.value = '';  
       
    18          }
       
    19         if(this.value != this.defaultValue){  
       
    20             this.select();  
       
    21         }  
       
    22     });  
       
    23     $('input[type="text"]').blur(function() {  
       
    24         $(this).removeClass("focusField").addClass("idleField");  
       
    25         if (this.value == ''){  
       
    26             this.value = (this.defaultValue ? this.defaultValue : '');  
       
    27         }  
       
    28     });   
       
    29 });