나를 도울 수있는 사람이 있기를 바랍니다. 동일한 페이지에서 google.code 시각화 도구와 jquery를 사용하고 있습니다.jquery 및 Google 표 시각화
문서에서 $(document).ready
함수를 호출하려고하지만 google.setOnLoadCallback(drawVisualization);
함수를 호출 할 때 문제가 있다고 의심됩니다. 여전히 테이블에 라이트 효과를 적용하지 않는 다음 document.ready
기능 이후에로드하고
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$(".gallery a[rel^='prettyPhoto']").prettyPhoto1({theme:'facebook'});
});
</script>
구글 시각화 표 다음에, 테이블의 링크 라이트 효과를 적용하는 방법에 대한 아이디어 로드 했습니까?
나는이 문제를 찾는 데 도움이 될만한 완전한 스크립트를 추가했습니다.
<script type="text/javascript">
google.load('visualization', '1', {packages: ['table']});
</script>
<script type="text/javascript">
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'No');
data.addColumn('string', 'Page URL');
data.addColumn('string', 'EDIT');
data.addRows(10);
<% while ((Repeat1__numRows-- != 0) && (!rs_page_1.EOF)) { %>
data.setCell(<%= Repeat1__index %>, 0, '<%=(rs_page_1.Fields.Item("g_page_no").Value)%>');
data.setCell(<%= Repeat1__index %>, 1, '<a href="<%=(rs_page_1.Fields.Item("g_page_site").Value)%><%=(rs_page_1.Fields.Item("g_page_url").Value)%>"><%=(rs_page_1.Fields.Item("g_page_site").Value)%><%=(rs_page_1.Fields.Item("g_page_url").Value)%></a>');
data.setCell(<%= Repeat1__index %>, 2, '<span class="gallery clearfix"><div class="btn_newsite"><a href="/application/functions/preview.asp?g_sites_no=<%=(rs_page_1.Fields.Item("g_sites_no").Value)%>&g_page_no=<%=(rs_page_1.Fields.Item("g_page_no").Value)%>&iframe=true&width=100%&height=100%" rel="prettyPhoto1[iframes]" title="View">Edit</a></div></span>');
<%
Repeat1__index++;
rs_page_1.MoveNext();
};
%>
// Create and draw the visualization.
visualization = new google.visualization.Table(document.getElementById('table'));
visualization.draw(data, {'allowHtml': 'true'}, {'showRowNumber': 'true'}, {'firstRowNumber': '1'});
}
google.setOnLoadCallback(drawVisualization);
</script>
<div id="table"></div><script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$(".gallery a[rel^='prettyPhoto']").prettyPhoto1({theme:'facebook'});
});
</script>
감사
안녕하세요, 답변을 주셔서 감사합니다. 그러나 아직 작동하지 않습니다. 반복 열이있을 수 있습니까? 라이트 박스가 필요할 때마다 함수가 필요합니까? 나는로드를하는 두 개의 다른 버튼에 라이트 박스를 가지고있다 (그러나 반복의 일부가 아닌가?). 그러나 반복의 한 번은 작동하지 않습니다 ... (단지 한번 호출되기 때문에?) –
@Gerald - 당신은'rel = "prettyPhoto1 [iframes]"가 올바르게 작동하지 않는 단 말입니까? –
예, Google 시각화 외부의 rel = "prettyPhoto1 [iframes] 버튼은 100 % 작동하지만 Google 시각화 내의 버튼은 작동하지 않습니다. (라이트 박스를 여는 대신 새 페이지가 열립니다.) - google 시각화 테이블이로드되고 rel = "prettyPhoto1 [iframes]"버튼이 표시되지만 클릭하면 라이트 박스가로드되지 않습니다. –