나는이에 아주 초보자 해요 궁금하면 나는이 스크립트에이 두 값Javascript에 값을 추가하는 방법은 무엇입니까?
maxScreenWidth: 480,
menuTitle: 'Menu:'
를 추가 할 수 어쨌든이있다.
function DropDown(el) {
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($('#mainNav'));
$(document).click(function() {
// all dropdowns
$('.dropdown-menu').removeClass('active');
});
});
미리 감사드립니다.
- 또한 내 웹 사이트에 적용 할 드롭 다운 메뉴입니다.
http://tympanus.net/Tutorials/CustomDropDownListStyling/index2.html
는 난 단지 전화 레이아웃이 메뉴를 적용하기 위해 노력하고있어하지만 상관없이 크기가 무엇인지 화면에 그 형태를 유지하지 않습니다. 480px 이상일 때 사라지는 것으로 추정 되나 그렇지 않습니다.
도움을 주셔서 대단히 감사합니다. 당신이 그 속성을 추가하려면
리스너가 호출 될 때 적용할까요? 그렇다면 관련 CSS 규칙 (예 : * 활성 * 클래스)에 추가하십시오. – RobG