faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 18 people (33%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

how can i rotate iamge at 90 degree for mozilla and internet explorer browser
how can i rotate image at 90degree,180,270degree using mozilla browser

Apr 9th, 2008 20:09
ha mo, Abolfazl Shirazi, ashish arya,


Abolfazl Shirazi:
To rotate an image in some specific degrees like 90,180,270, You 
should use a special filter.
You just need to put your IMG Tag in a DIV Layer and apply that filter 
to this layer.
But Watch out! this filter will not work if you don't set Width 
property in DIV Layer.
It means that setting Width property is necessary for this filter to 
work!
Try the codes below in your page (Note:The file mypic.jpg should be 
available!) :
<!-- Begin -->
Rotate 90 degree
<div style="filter:progid:DXImageTransform.Microsoft.BasicImage
(rotation=1);width:160">
<img src="mypic.jpg" width="160" height="120">
</div>
<p>
Rotate 180 degree
<div style="filter:progid:DXImageTransform.Microsoft.BasicImage
(rotation=2);width:160">
<img src="mypic.jpg" width="160" height="120">
</div>
<p>
Rotate 270 degree
<div style="filter:progid:DXImageTransform.Microsoft.BasicImage
(rotation=3);width:160">
<img src="mypic.jpg" width="160" height="120">
</div>
<p>
<!-- End -->
As you can see each rotation number in filter property is related to a 
specific degree:
rotation=1 >> 90 degree
rotation=2 >> 180 degree
rotation=3 >> 270 degree
This filter works successfully in IE6.
I don't know what should we do for other arks like 30 or 60 degree.
Enjoy It Friend!!!
http://www.businessian.com
http://www.healthinhealth.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com