stcherenkov / explorercanvas

Automatically exported from code.google.com/p/explorercanvas
Apache License 2.0
0 stars 0 forks source link

Is this library support globalAlpha property for IE ? #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Does not work  globalAlpha value change in IE8.0 

What is the expected output? What do you see instead?
 I want same feect for Firefox3.6、Google Chrome 

What version of the product are you using? On what operating system?
 Explorercanvas:R3
 WinXP:IE8
 DocType:HTML5
Please provide any additional information below.
 I use jQuery1.4 too.

 (See http://yoneyone.my-sv.net/HTML5canvas2.htm )

 My codes is bellow
HTML

<canvas id="canvas" width="650" height="530"></canvas>

Javascript

 var G_vmlCanvasManager;
$(function(){
 var fadeTimer;
 var canvas = document.getElementById("canvas");
 if (typeof(G_vmlCanvasManager) != 'undefined')
  canvas = G_vmlCanvasManager.initElement(canvas);
 var ctx = canvas.getContext('2d');
 ctx.globalAlpha = 0;
 var mainimg = new Image();
 mainimg.src = "/image/mio.jpg?" + new Date().getTime();
 mainimg.onload = function() {
  fadeIn(mainimg);
 }
  $(".thumbnail").mouseover(function(){
   ctx.globalAlpha = 0;
   mainimg.src = $(this).parent().get(0).href+"?"+ new Date().getTime();
 });

 $(".thumbnail").click(function(){
  return false;
 });

function fadeIn(img){
  image = img;
  StopFade();
  fadeTimer = setInterval(function(){
    if (ctx.globalAlpha > 0.9) {
      ctx.globalAlpha = 1;
      StopFade();
    }else ctx.globalAlpha += 0.1;
    ctx.drawImage(image,25,10,600,500);
  },100);
}

function StopFade() {
  if(fadeTimer){
    clearInterval(fadeTimer);
    fadeTimer=null;
  }
}

});

Original issue reported on code.google.com by yyr...@gmail.com on 10 Sep 2010 at 6:31