c# - Change size of image control in javascript -


I want to change the size of images in javascript onmouseover.

String () = Directory.GetFiles (Server.MapPath ("~ / Folder1 / Folder2 /"), "* .jpg") as the dim files

  File = file in the file as string for each file. Last index ("/") + 1, file. Lang) 'Response Write (file & amp; & lt; br & gt; ") file = file & dim image = new image (as image) & image.ImageUrl = file image.ight = 50 Image.Width = 50 Me.Controls.Add (image) image.Attributes.add ("onmouseover",  

Here is some HTML < / P>

strong>

  & lt; ASP: button id = "button1" runat = "server" text = "button" validation group = "none" /> ; & Lt; ASP: panel id = "panel1" runat = "server" style = "display: none; background color: transparent; padding: 1am6px;" backcolor = "white" & gt; ; & Lt; ASP: panel id = "panel2" run = "server" style = "background color: black;" width = "265px"> gt; & gt; table & gt; & lt; tr & gt; Lt; td align = "right"> asp: ImageButton id = "cancel button" CssClass = "bttnCancel" runat = "server" text = "cancel" ImageUrl = "~ / images / bttnCancel.gif "Validation Group =" none "/>  gt; & lt; / TR & gt; & lt; / table & gt; & lt; / ASP: Cell & gt; & Lt; / ASP: Cell & gt;  

I recommend setting up this JS functionality cleint side:

Depending on how your images are added in the HTML Doc, You can use jQuery to listen to events and change the size of ur images ...

View in jQuery:

  $ (document). Ready (function () "ATR" ("width", "100");}) mouseot (function ($ ("image thumb img"). Mouseover (function {$ (this) .attr ("height", " 100 ").) {$ (This) .attr (" height "," 50 "). Atri (" width "," 50 ");})});  

Add code to the back

  image.CssClass = "thumbImg";  

Add a CSS class to the panel 2

  & lt; Asp: panel id = "panel2" runat = "server" cssClass = "thumb" style = "background color: black," width = "265px">  

You can only add / remove CSS class, you need to fix JS to match ur HTML, use online document to help you, but it The answer is

>

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -