0
나는이 사이드의 JQuery UI 아코디언을 가지고있다. 나는 섹션의 클릭 이벤트에 대한 추가 작업을 할 내가있어이 this SO와 반응에 따라 작업 : 작동 이제터보 링크와 아코디언이있는 레일
$(".sidebar_category").click(function(event) {
// the section contains a span and my anchor; only go when
// the click is over the anchor
if (event.target.href !== undefined) {
window.location = event.target.href;
}
});
...하지만 다른 링크에 같은 방식으로 클릭 왜냐하면 터보 링크를 사용함으로써 AJAX switcheroo가 수행되어서 에뮬레이트하고 싶기 때문입니다.
바늘은 simulating a click이 트릭을하지 않는다고 말합니다. 나는 this :
<html>
<head>
<script type="text/javascript" src="jquery-1.3.1.js"></script>
<script type="text/javascript" src="jquery.form.js"></script>
<script>
$(document).ready(function(){
$('a').bind('click',function(event){
event.preventDefault();
$.get(this.href,{},function(response){
$('#response').html(response)
})
})
});
</script>
</head>
<body>
<li><a href="response.html"/>Response</a>
<div id="response"></div>
</body>
그러나 레일 스타일과 같은 것을 기대하고 있습니다. 그러면 링크 터보 링크 스타일을 어떻게 따릅니 까?
PS : 내 제거 gemfile :
gem 'rails', '4.0.0'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jquery-ui-sass-rails'
gem 'jquery-ui-themes'
gem 'turbolinks'
...
네, 고맙습니다. 나는 "레일 스타일"에 대해 물어 보았습니다. 아마도 일종의 방법이었을 것입니다. –