Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can I hide my drop-down menu option(s)?

user-image
Question added by Rana Alnajjar , Web developer , Lebcards
Date Posted: 2015/05/26

You can try following by replacing

$classView.hide();// I tried

with

$('.wrapper-dropdown-1').addClass('active'); $student.click();

mahboob khan
by mahboob khan , Project Student Information System , TekNords Inc Swat.K.P.K

<divclass="row cb-btns-row "style="background-color:white;"><divclass="col-xs-3 col-sm-3 col-md-3 col-lg-3"><divid="dd"class="wrapper-dropdown-1"tabindex="1"><span>Class View </span><ulclass="dropdown"><li><aid="class-view"href="#">Class View</a></li><li><aid="student#1"class="student"href="#">Geary, Mia</a></li></ul></div></div></div>js // dropDown Menu function dropDown(el){this.dd = el;this.placeholder =this.dd.children('span');this.opts =this.dd.find('ul.dropdown > li');this.val ='';this.index =-1;this.initEvents();} dropDown.prototype ={ initEvents:function(){var obj =this; obj.dd.on('click',function(event){ $(this).toggleClass('active');returnfalse;}); obj.opts.on('click',function(){var opt = $(this); obj.val = opt.text(); obj.index = opt.index(); obj.placeholder.text(obj.val);});}, getValue:function(){returnthis.val;}, getIndex:function(){returnthis.index;}} $(function(){var dd =new dropDown($('#dd')); $(document).click(function(){ $('.wrapper-dropdown-1').removeClass('active');});var $student = $('.student');var $classView = $('.classView'); $classView.hide();// I tried});

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.