Sandeep February 2016

from 1 d3.select hide another div

I have 2 different divs having different id's #context-menu & #create-context-menu

d3.select('#context-menu')
  .style('display', 'inline-block')
  .on('mouseleave', function() {
       d3.select('#context-menu').style('display', 'none');
       context = null;
   });

I want to hide #context-context-menu div, not onMouseLeave --> From this d3.select I want to hide another div(#create-context-menu).

Answers


Gilsha February 2016

d3.select('#context-menu')
  .style('display', 'inline-block')
  .on('mouseover', function() {                   
      //To hide the div with id create-context-menu
      d3.select('#create-context-menu').style('display', 'none');
      //OR          
      //d3.select('#create-context-menu').style('opacity', 0);
  });

Note: To get the div with id context-menu inside the mouseover function, you can use d3.select(this)


Karthikeyan February 2016

Try this to hide the div,

$('#context-menu').on('mouseover',function(){
   $('#create-context-menu').hide();
});

If you want to make the inputs to be disabled use

$('#create-context-menu :input').attr('disabled', true);

Post Status

Asked in February 2016
Viewed 2,161 times
Voted 11
Answered 2 times

Search




Leave an answer