dポイントプレゼントキャンペーン実施中!

ボタン押下するたびに、画像を90度→180度→270度→戻るという風に
角度変更処理をしたいと考えています。

そこで以下の様なJavaScriptで画像をPタグで囲んだエリア"AREA"をDXImageTransform.Microsoft.BasicImageで角度変更を行いました。
===============================================
document.getElementById("AREA").style.filter = "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"
===============================================
IEでは正常でしたが、FireFox3.0では動作しませんでした。
progid:DXImageTransform.Microsoft.BasicImageはFireFoxは動作しないのでしょうか?

そうであれば、FireFoxで動作可能な方法をお教え頂けないでしょうか?

A 回答 (2件)

おもいっきり Microsoft と入っていることから、IE向けのオブジェクトのようにお見受けします。


他ブラウザようにあるかどうかまでは探してません。
あらかじめ回転した画像を用意しておいて差し替えてみては?

参考URL:http://www5e.biglobe.ne.jp/~access_r/hp/filter/

この回答への補足

御回答、誠に有り難うございます。
参考URLのfilterですが、これまたIE独自のものらしいです。。。

補足日時:2008/10/10 09:40
    • good
    • 0

====================Q4370469-1.xhtml========================


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dt …
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Q4370469 TestCase 1</title>
<script type="application/ecmascript">
//<![CDATA[
function init(){
var svg = document.getElementById("hoge").contentDocument.rootElement;
var img = svg.getElementsByTagNameNS("http://www.w3.org/2000/svg","g")[0];
img.setAttribute("transform","rotate(45,50,50)");
}
//]]>
</script>
</head>
<body onload="init();">
<p><object id="hoge" type="image/svg+xml" data="Q4370469-1.svg"/></p>
</body>
</html>

<!--

This sample rotates the image 45 degrees.

Before you use this code,

you MUST keep in mind you have to remove ZERO WIDTH SPACE added by oshiete-goo's system.
you MUST prepare Q4370469-1.svg and Q4370469-1.png.
I used 100px * 100px square filled with plain red.

SVGSVGElement.getElementById not implemented
https://bugzilla.mozilla.org/show_bug.cgi?id=280 …

SVG images in CSS
https://bugzilla.mozilla.org/show_bug.cgi?id=231 …

external SVG not loaded from img tag
https://bugzilla.mozilla.org/show_bug.cgi?id=276 …


This solution does not seem to work for safari if this document is provided as text/html.
I'm not sure the following stuffs will do.

CSS Transforms
http://webkit.org/specs/CSSVisualEffects/CSSTran …

Add support for WebKit's CSS3 Transform proposal
https://bugzilla.mozilla.org/show_bug.cgi?id=435 …
For Gecko 1.9.1+(not for Gecko 1.9)

HTML 5 Canvas
http://www.w3.org/html/wg/html5/#the-2d-context

-->

===========Q4370469-1.svg====================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g xml:id="target" transform="rotate(0,0,0)">
<desc>This graphic links to an external image
</desc>
<image x="0" y="0" width="100px" height="100px" xlink:href="Q4370469-1.png" >
<title>My image</title>
</image>
</g>
</svg>
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!