Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i am doing the website with functionality of zooming

XML
<span>
     <a  id="placeholder" runat="server" rel="zoom-width:600px; zoom-height:600px" class="MagicZoom">

   <asp:Image ID="images" BorderWidth="1px" BorderColor="LightGray" runat="server"   onerror="this.onerror=null;this.src='../Image/noimage2.png'" Width="250px" /></a>

               </span>



on page loads

i am assigning the value like

this.images.ImageUrl = "../Image/temp/" + stylecode.Trim() + ".jpeg";

placeholder.HRef = "../Image/temp/" + style_code.Trim() +".jpeg";

on mouse over i am using the function like
string mainimgurl = "../Image/temp/" + style_code.Trim() + hdncolorcode.Value.Trim() + ".jpeg";
lblcolorname.Attributes.Add("onmouseover", "javascript:setmainimgg('" + mainimgurl + "');");

and javascript function is

XML
function setmainimgg(iiisd) {
                       document.getElementById(<%= images.ClientID %>).src = iiisd;
                       document.getElementById(<%= placeholder.ClientID %>).href = iiisd;
                   }

here images control value is changed it's shows the correct image. But the problem is href(anchor tag) path is not changing. if the value path changes means the zoom will work i can't assign the value for anchor tag.
Posted
Updated 11-Sep-13 1:25am
v2

 
Share this answer
 
v2
Comments
Member 8177239 11-Sep-13 7:32am    
in cs page on page load i have used

placeholder.HRef = "../Image/temp/" + style_code.Trim() +".jpeg";
Joezer BH 11-Sep-13 9:14am    
yes, but Javascript does not know the CS objects.
In the CS you call the object by it's name, in Javascript you need to get the element by it's ID, hence the document.getElementById function that I showed.

Did you try it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900