1.

Solve : Changing image width?

Answer»

Hey, I'm trying to think up a way to change the width of an image depending on a NUMBER which will be entered by the user. I created a quick example of what I am looking for in Microsoft Visual Basic (which I accessed through MSWord 2003) and it is attached. Just enter a number in the text box and hit the command button next to it, then the top button's width will change accordingly.

[attachment deleted by admin]Is this not programming? Quote from: kpac on September 23, 2009, 09:47:11 AM

Is this not programming?
No, it's web design. I just showed an example of what I meant in MSVB. I'm sorry I didn't add that part in before, the page refreshed after switching tabs, so I lost all I wrote.  What language are you using? JavaScript? PHP? Quote from: kpac on September 24, 2009, 02:02:38 PM
What language are you using? JavaScript? PHP?
Well I don't KNOW PHP at all, but any language is appreciated if it can be done (and I can use it).Likely JavaScript if you want it on a web site.
Here is one place to look:
http://javascript.internet.com/
Even if you don't find anything, the girl is cute
Quote from: Geek-9pm on September 24, 2009, 05:29:51 PM
Even if you don't find anything, the girl is cute

WHAT?
Quote from: Helpmeh on September 24, 2009, 07:58:33 PM
WHAT?
Eh, never mind.

Err, try this for size:

CODE: [Select]<html>
<head>
  <title>JS Test</title>
</head>

<body>
  <script type="text/javascript">
    var size = prompt("PLEASE enter a size for the image.","45");
    if (size != null && size != "")
    {
      document.write("<img src='path/to/image' width=' + size + ' />");
    }
  </script>
</body>
</html>
I can't test this right now, but can it be changed after the image has been displayed once, or is it a one-time thing per load?JavaScript can reload an image without reloading the who page.


Discussion

No Comment Found