2011-09-03 2 views
1

JavaScript를 사용하고 있지 않습니다. 멋진 달력 스크립트를 찾았지만 월 전환 단추가 없습니다. 한 달 동안 "다음"과 "이전"단추를 추가하는 몇 가지 방법을 시도했지만 성공하지는 못했습니다. 도움이 필요하다!월 전환기를 JS 캘린더에 추가하십시오.

당신은 오프셋 및 버튼 이전/다음 달 후 수정 현재 달 숨겨진 입력을 할 수 있습니다 : 여기가 내가 s'pose이 할 수있는 몇 가지 방법이 있지만, 여기에 하나의

+0

이 일정 스크립트의 홈페이지는 무엇에? 거기에 문서가 있습니까? –

+1

다음은 캘린더의 홈페이지 http://eisabainyo.net/demo/jquery.calendar-widget.php와 사용법에 대한 설명입니다. 답변을위한 – Toon

답변

0

일정 http://test.wowspace.ru/index.html입니다 JS는 이것을 수용 할 수 있습니다.

<!-- Hidden input goes in the index.html page --> 
<input type="hidden" id="id_month_offset" name="month_offset" value=0 /> 

<!-- Put links somewhere in the index.html page --> 
<a href="#" onclick="update_cal(-1); return false;">Prev</a> 
<a href="#" onclick="update_cal(1); return false;">Next</a> 

<!-- Add the update_cal script --> 
<script type="text/javascript"> 
    function update_cal(n){ 
     var offset = $("#id_month_offset"); 
     offset.val(parseInt(offset.val())+n); 
     $('#calendar').calendarWidget({}); 
    } 
</script> 

변경

는 calen.js 파일에 대한 수 :
변경 var month = now.getMonth();
var month = now.getMonth() + parseInt($("#id_month_offset").val());

+0

Thx! 그러나이 해결책은 효과가 없습니다. 결과는 http://test.wowspace.ru/index2.html – Toon

+0

입니다. @Toon, 응답 지연에 대해 사과드립니다. 나는'.val()'이 문자열을 반환하고있는 것으로 나타났습니다. 값으로 int를 사용하려면'parseInt()'함수를 사용해야 할 것이다. 내 대답을 업데이트하여 사용 위치를 표시했습니다. 희망은 도움이 –

+0

예! 그것은 작동합니다! 고맙습니다! – Toon