Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mouseout is not working as expected

Posted on 2014-12-13
1
Medium Priority
?
97 Views
Last Modified: 2014-12-14
I'm dynamically generating a list of checkboxes, I want this to dissapear as soon as I mouse out, but it dissapears
when I move my mouse out of Fldsbutt

<div class="container" id = "container"> 
        <div class="form-group">         
                <label for="selfile" class="col-sm-2 control-label">  Select File </label>  
                        
                <?php
                
                    $options = generate_files();
                    echo '<select id="selfile" name="selfile">'.$options.'</select>';                    	        
                ?>
              
        </div>
       
       
          <div class="form-group"  id="fieldsdiv" >         
              <label for="selfile" class="col-sm-2 control-label">  Fields </label> 

        	
        	 			   
        	    <button id="Fldsbutt"  class = "multiSelect ui-widget sd ca"  type="button"  tabindex = "0" style="width:225px;">
        	    
            	     <span class="ui-icon ui-icon-triangle-2-n-s"></span>
            	     <span id="Pstext" class= "ui-text"> </span>
            	     
        	     </button>    <span id="pleaseWait"> </span>
        	     
            	    <div id="selfields" class="multiSelectOptions">
            	    	    
            	    </div> 	
        	     	
        	    <span id="Pss">     </span> 		 		   		 		
             </div>		  	  	 	 	  	 	  		 		  	  										
 	 
          
        
              
          
       
            
                         
    
            
      </div>      
   
   <script>


   
   var base_url = '<?php echo site_url() ?>';
   var controller = 'gen';
   var method = 'mixed';

    $(function() {	
	   $('#selfile'). change(function() {
			 
		   var $file = $('#selfile').val();
		      		      
		      if($file !== undefined)
		      {
		    		
		    	     var	 $path = $file;    
  		    	        		    	   	    	    			     
  		    	 $.ajax({							
  						url: base_url+'/'+ controller +'/' + method,
  						type: "POST",
  						data: {
  							file: $path,
  							},
  						success: function(ret_data) {
      						if (ret_data != 'error')
      						{	
      							$('#pleaseWait').html('Click the arrow to select fields');
      						    $('#selfields').html(ret_data);
      						    $('#selfields').hide();
      					     } 

      						else  	$('#pleaseWait').html('');
  						}			
  						}); 
		      }	    });
		
		
		$('#selfields').mouseout(function() {
			    console.log('mouseout');
			    $('#selfields').hide();
							

			});
		    	    

		$('#Fldsbutt'). click(function() {
	 
		    $('#selfields').show();
		    
		   });  		
		});	
		
	       
  </script> 
  
 </body>
 </html>  

Open in new window

0
Comment
Question by:sniger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 2000 total points
ID: 40498865
For me it works perfectly.

I think probably you're forgetting that selfields is a div and is using the whole width.
So even if you're entering an area that looks like it doesn't belong to it, chances are that it is.

Just to make sure try setting a border for that div to have a visual reference o fit's boundaries:
.multiSelectOptions{border: solid 1px #000;}

Open in new window


Here's the fiddle that I used to test: http://jsfiddle.net/AlexCode/o7vuko5t/
Looks bad, and I disabled all the dynamic stuff, but it's enough to test the scenario.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question