[英]jquery.appear - How to add on a canvas-element?
如何將jquery.appear -Plugin 添加到此畫布元素 (id="pic")? 腳本本身已經包含在 html 頁面中,但是如果元素在屏幕上,如何使畫布圖像僅可見?
<canvas id="pic"></canvas>
<script type="text/javascript">
var picData6 = whatever1
var options = whatever2
var ct6 = document.getElementById("pic").getContext("2d");
ct6.canvas.width = document.getElementById("pic").offsetWidth-4;
ct6.canvas.height = document.getElementById("pic").offsetHeight;
var Chart6 = new Chart(ct6).Line(picData6,options);
</script>
似乎.appear()必須添加到某處。 但是哪里?
非常感謝!
jQuery.appear 只是為您注冊的元素提供自定義的appear
和disappear
事件。
要將其添加到您的畫布,您可以執行以下操作:
// register the element with the plugin
$('#pic').appear();
// do this when it appears
$('#pic').on('appear', function(ev, elements) {
// elements is an array of elements which are now visible on the page
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.