I am beginning a lot on this and I am thinking that I can add these two values < Pre> In this script. Thanks in advance. I am trying to apply this menu only for phone layout but it maintains its size even if the screen size is what it is. If you want to add those properties, just add them as below: Now they are part of your constructor, as a passable argument Then when you call the constructor, then just those values should be passed < / P> MaximumscreenWidth: 480, Menu Title: 'Menu:'
function dropdown (L) {this.mainNav = el; This.initEvents (); } DropDown.prototype = {initEvents: function () {var obj = this; Obj.mainNav.on ('click', function (event) {$ (this) .toggleClass ('active'); event.stopPropagation ();}); }} $ (Function () {var mainNav = new dropdown ($ ('# menonave')); $ (document). Click (function () {// all dropdown $ ('. Dropdown-menu'). RemoveClass ('Active');});});
function dropdown (L, width, title) {this.mainNav = el; This.maxScreenWidth = width; // Added this.menuTitle = Title; // Added this.initEvents (); }
$ (function () {var mainNav = new DropDown ($ ('# mainNav'), 480, 'menu') // See, pass them here. $ (Document). Click (function () (/) All dropdown $ ('. Dropdown-menu'). RemoveClass ('active');});});
No comments:
Post a Comment