FlipV and FlipH filters can be used to flip images vertically or horizontally in IE (These filters works in IE only). the following code shows you how to control an image by using the HTML Select Tag to FlipV, FlipH or Apply both filters at the same time.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html> 
<head> 
 
<title>Applying FlipV and FlipH using the Select tag (IE Only)</title> 
 
<script language="JavaScript">
	function change()	
	{
var sel = document.getElementById("SelectFilter");
var SelectV = sel.options[sel.selectedIndex].value;
 
if (SelectV == 'NoFilter')
{ document.getElementById("x").style.filter = '' }
 
else if (SelectV == 'FlipVH')
{ document.getElementById("x").style.filter = 'Filter: flipV + Filter: flipH' }
 
else
{ document.getElementById("x").style.filter = (SelectV == 'FlipH') ? 'FlipH' : 'FlipV'; }
	}
</script>
 
</head> 
 
<body> 
 
<br><br>
<select id="SelectFilter" onChange="change()">
<option value="NoFilter">No Filter
<option value="FlipH">Flip H
<option value="FlipV">Flip V
<option value="FlipVH">Both
</select>
<br><br><br>
<img src="image-name.jpg" id="x">
<br><br>
 
</body> 
 
</html>

One Response to “Flipping an image vertically or horizontally using the Select tag (IE Only)”

Leave a Reply

Spam Protection by WP-SpamFree

Haider’s WebSpace
Welcome to my technical blog. This is where I write, archive and share computer related articles. Subjects vary from posting technical solutions to researching particular topics. Feel free to comment and talk IT!
Sponsored Links
Posts Calendar
August 2010
M T W T F S S
« Feb    
 1
2345678
9101112131415
16171819202122
23242526272829
3031