당신은 .tempo-head
에 click()
이벤트를 할당 및 요소에 다른 것들의 무리를하고있는이 모호한 질문에 대한 그래서 모든 도움을 최대한 미안
덕분에 그들은에로드되기 전에 아약스 루틴에 의한 페이지.
다음 기능을 사용하려면 최신 버전의 JQuery를 구해야합니다. 난 당신이 현재 (1.4.2)
보십시오 변화를 오래된 버전이있는 것으로 나타났습니다이 :
$('.tempo-head').click(function() {
모든 아코디언 루틴 내부
$('#sidebar').on('click', '.tempo-head').click(function() {
또는
이동
에
success
아약스 전화 콜백은 아래와 같습니다.
$(document).ready(function(){
var cidade2='penafiel';
var dataString = 'cidade='+ cidade2;
$.ajax({ type: "POST", url: "processtempo.php", data: dataString, cache: false,
success: function(html){
$("#exibe_tempo").html(html);
}
});
$(".cidade").change(function(){
var cidade=$(this).val();
var dataString = 'cidade='+ cidade;
$.ajax({ type: "POST", url: "processtempo.php", data: dataString, cache: false,
success: function(html){
$("#exibe_tempo").html(html);
//Add Inactive Class To All Accordion Headers
$('.tempo-head').toggleClass('head-off');
//Set The Accordion Content Width
var contentwidth = $('.tempo-head').width();
$('.tempo-cont').css({'width' : contentwidth });
//Open The First Accordion Section When Page Loads
//$('.tempo-head').first().toggleClass('head-on').toggleClass('head-off');
//$('.tempo-cont').first().slideDown().toggleClass('tempo-cont');
// The Accordion Effect
$('.tempo-head').click(function() {
if($(this).is('.head-off')) {
$('.head-on').toggleClass('head-on').toggleClass('head-off').next().slideToggle().toggleClass('tempo-cont');
$(this).toggleClass('head-on').toggleClass('head-off');
$(this).next().slideToggle().toggleClass('tempo-cont');
}
else {
$(this).toggleClass('head-on').toggleClass('head-off');
$(this).next().slideToggle().toggleClass('tempo-cont');
}
});
}
});
});
return false;
}); // END DOC READY
코드의 관련 부분을 여기에 게시하고 페이지 소스를 검색하지 마십시오. 또한 jsFiddle.net과 같은 사이트에서 문제의 예를 만드는 것이 유용합니다. – j08691
그래 ... 나도 알아야 해. 죄송합니다. 코드의 어떤 부분을 붙이면 될지 모르겠습니다. –