Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 40336 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > JavaScript > How to Flip and Zoom the Image using JavaScript ...
Neeks

How to Flip and Zoom the Image using JavaScript

 Code Snippet posted by: Neeks | Posted on: 2/28/2009 | Category: JavaScript Codes | Views: 6922 | Status: [Member] | Alert Moderator   


JavaScript
<%--Script for the ASPX page. We have to keep this Script in our Head section of the Page--%>

<script language="javascript" type="text/javascript">
//This function will be used on mouse enter evert of the Image
function fnFlp()
{
//Here, we are checking the condition whether we wanto Zoom or Flip the Image
if(document.getElementById('ddl').value == 1)
document.getElementById('img').style.zoom = '200%';
else
document.getElementById('img').style.filter = 'fliph';
}
//This function will be used on mouse out evert of the Image
function fnFlpOut()
{
//Here, we are checking the condition whether we wanto Zoom or Flip the Image
if(document.getElementById('ddl').value == 1)
document.getElementById('img').style.zoom = '100%';
else
document.getElementById('img').style.filter = '';
}
</script>


Code for the ASPX Page
<form id="form1" runat="server">

<div>

Example to show the Use of Image's Style [Flip and Zoom]
<hr />
<%--We have to keep this code in our ASPX page's Body part.--%>
<%--Creating the DropDownList control for the Option of the Images--%>
<asp:DropDownList runat="server" ID="ddl">
<%--Creating Diferent options for the DropDownList--%>
<asp:ListItem Value="0">Flip</asp:ListItem>
<asp:ListItem Value="1">Zoom</asp:ListItem>
</asp:DropDownList><Br />
<%--Creating the Image for the Operation. Here we are assigning the functions fnFlp() and fnFlpOut() to
onmouseenter and onmouseout events respectively.
--%>
<img id="img" src="../Image/Img/telephone.gif" onmouseenter="fnFlp()" onmouseout="fnFlpOut()" />
</div>

Found interesting? Add this to:


 Responses

Poster
Posted by: Poster | Posted on: 2/28/2009 | Level: Starter | Status: [Member] | Alert Moderator 

Hi Neeks,

I think this code only works in IE not in FireFox and Chrome. Do you have any such code that can work in both IE and Firefox?

>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/20/2013 7:46:17 AM