나는 파일의 나머지 부분은 jQuery를 호버 이벤트를 제외하고 작업을 명령 JS 파일 (하지 백본)에 다음 코드를했다 : 여기문제 3
$ ->
$("#welcome").modal "show"
$(".george").hover ->
$(".peche").fadeIn(1000).css("display","inline-block")
$(".peche").fadeOut(300).css("display","none")
$("#yes").click ->
$("#welcome").modal "hide"
$("#prospective_user").modal "show"
$("#no").click ->
$("#welcome").modal "hide"
$("#returning_user").modal "show"
$("#back").click ->
$("#prospective_user").modal "hide"
$("#welcome").modal "show"
$("#backto").click ->
$("#returning_user").modal "hide"
$("#welcome").modal "show"
는이다 요소가 마우스 커서를 올려 확인한 수와 요소를 표시 할 수와 백본 ECO 템플릿을 사용 :
.peche{display:none;}
:
<% for post in @posts.models: %>
<tr class="george"><td>
<center><div class="postdata">
<% if post.get('content').length > 140: %>
<%=post.get('content').substring(0, 140)+"\t\t"%>
...<a href="show/<%= post.get('id') %>">see more</a>
<% else: %>
<%= post.get('content') %>
<% end %>
<br></div></center>
<span class="peche"><center>
<a href="<%= post.get('id') %>/like" data-remote="true">Agree</a>
<a href="<%= post.get('id') %>/dislike" data-remote="true">Disagree</a>
<a href="voice/<%= post.get('id') %>">Voice</a>
<a href="show/<%= post.get('id') %>">Comment</a>
<a href="report/post/<%= post.get('id') %>">Report</a>
</center></span></td></tr>
<% end %>
과 페쉬를위한 CSS3210
왜이 호버 이벤트가 작동하지 않습니까? 위의 에코 템플릿은 내 백본 응용 프로그램의 일부인 반면 js 파일은 javascript/폴더에 있습니다. 이 일하면 안돼? JSFiddle에서 정규 HTML과 .eco를 사용하지 않고 작업했습니다.
같은 것으로 코드를 업데이트하려고은'실행하는 전화 hover' DOM을 당신의'$ (". 조지").에서 .george'인가? –
나는 localhost에서 내 소스를 볼 때 볼 수없는 백본 템플릿에 있습니다. – godzilla3000
그러면 rorra의 대답이 올바른 접근 방식처럼 보입니다. 또는'.george' 이벤트를'.george'가있는 뷰에 통합 할 수 있습니다. –