안녕하세요 저는 pickadate.js이라는 jQuery 플러그인을 사용하고 있습니다. 그러나 나는 주제를 바꾸는 방법을 얻을 수 없다. 테마에는 기본 및 고전 두 가지가 있습니다. 나는 그것을 고전으로 바꾸고 싶다. 당신은 당신이 원하는 테마 테마 CSS를 포함jQuery pickadate 테마를 변경하는 방법
2
A
답변
1
...하여 플러그인 홈 페이지가 .. this pages source 확인과 같이 테마 선택기를 원하는 경우 Docs are here
...
HTML :
<span class="menu__link">
Themes:
<input class="theme-toggle__input" type="radio" id="show_theme_default" name="show_theme" value="default" checked hidden>
<label class="theme-toggle__label" for="show_theme_default">default</label> and
<input class="theme-toggle__input" type="radio" id="show_theme_classic" name="show_theme" value="classic" hidden>
<label class="theme-toggle__label" for="show_theme_classic" class="checked-negative">classic</label>
</span>
자바 스크립트 :
var themeSelected = window.localStorage ? localStorage.getItem('theme') : '',
$themeLinks = $('#theme_base, #theme_date, #theme_time'),
updateStylingLinks = function(value) {
value = value || 'default'
$('#show_theme_' + value).attr('checked', true)
$themeLinks.detach()
$themeLinks.each(function() {
this.href = this.href.replace(/(.+\/)(\w+)(.+)/, '$1' + value + '$3')
})
$themeLinks.appendTo('head')
}
if (themeSelected) {
updateStylingLinks(themeSelected)
}
$('[name=show_theme]').on('change', function() {
var value = this.value
updateStylingLinks(value)
if (window.localStorage) {
localStorage.setItem('theme', value)
}
})
1
테마
모든 테마는 LESS를 사용하여 생성되고 lib/themes 폴더로 컴파일됩니다.
- 하나의 기본 스타일 시트가 필요합니다. 테마를 선택한 다음 각 선택기도 포함하십시오.
0
내 목표는 사용자가 모바일 (기본 테마)에 있던 경우에 또는 바탕 화면 (고전 테마)에 따라 두 테마를 사용하는 것이 었습니다. 자신의 .LESS 파일을 수정하지 않고
(로 버전 업그레이드 중요하다), 나는이에 CSS 클래스를 제거/추가, 자바 스크립트를 사용하여 below-
다음@import "../bower_components/pickadate/lib/themes-source/_variables.less";
@import "../bower_components/pickadate/lib/themes-source/base.less";
@import "../bower_components/pickadate/lib/themes-source/base.date.less";
body.pickadate--default {
@import "../bower_components/pickadate/lib/themes-source/default.less";
@import "../bower_components/pickadate/lib/themes-source/default.date.less";
}
body.pickadate--classic {
@import "../bower_components/pickadate/lib/themes-source/classic.less";
@import "../bower_components/pickadate/lib/themes-source/classic.date.less";
}
같은 다른 CSS의 namespacings 각을 warpped 본문에 따라 내 화면 크기 -
var isDesktop = Modernizr.mq('(min-width: 768px)'); //Modernizr media queries
if (isDesktop) {
$("body").addClass("pickadate--classic");
$("body").removeClass("pickadate--default");
} else {
$("body").addClass("pickadate--default");
$("body").removeClass("pickadate--classic");
}
참고 : window.resize에서도 JS 기능을 호출해야합니다.
관련 문제
- 1. CPTXYGraph의 테마를 변경하는 방법
- 2. JOptionPane 테마를 변경하는 방법
- 3. Eclipse에서 색상 테마를 변경하는 방법
- 4. 에이스 편집기 테마를 변경하는 방법
- 5. Owl carusel/테마를 변경하는 방법
- 6. Android TimePicker 테마를 변경하는 방법?
- 7. 런타임시 색상 테마를 변경하는 방법
- 8. vb.net에서 스크롤바 테마를 변경하는 방법?
- 9. mvc3에서 테마를 동적으로 변경하는 방법
- 10. YAF (yetanotherforum) 테마를 변경하는 방법
- 11. joomla 레이아웃, 테마를 변경하는 방법?
- 12. prestashop 테마를 동적으로 변경하는 방법
- 13. 안드로이드에서 특정보기의 테마를 변경하는 방법
- 14. 콤보 상자에서 jqgrid의 테마를 변경하는 방법
- 15. jquery 테마를 재정의하는 방법
- 16. jquery mobile에서 테마를 동적으로 변경하는 방법은 무엇입니까?
- 17. jquery 모바일에서 패널 이미지 및 색상 테마를 변경하는 방법
- 18. sugarcrm의 테마를 변경하는 단계
- 19. pickadate 플러그인의 jquery 게시물에서 배열 가져 오기
- 20. 동적 입력 필드에 pickadate jquery 플러그인 적용
- 21. Mozilla 개발자 도구 테마를 변경하는 방법
- 22. asp.net mvc 2에서 테마를 변경하는 방법
- 23. SWT 응용 프로그램에서 테마를 변경하는 방법
- 24. 코드를 통해 동적으로 테마를 변경하는 방법
- 25. 에이스 편집기 : 동적으로 테마를 변경하는 방법
- 26. VS20010 테마를 VS2010과 비슷하게 변경하는 방법
- 27. 프로그래밍 방식으로 전화에서 테마를 변경하는 방법
- 28. ipad에서 splitview의 배경 그래픽/테마를 변경하는 방법?
- 29. 안드로이드 애플 리케이션의 색상 테마를 변경하는 방법?
- 30. 코드에서 완전히 작성된 조각보기의 테마를 변경하는 방법
[플러그인의 Github 저장소] (https://github.com/amsul/pickadate.js)에서 2 분이 경과하면 [themes 폴더가 /v2/themes](https://github.com/)에 표시됩니다. amsul/pickadate.js/tree/gh-pages/v2/themes). 당신은 노력의 부족에 대한 downvote를 얻을 – Bojangles