Solved

ASP.net VB.net Move image on button click

Posted on 2013-10-22
4
570 Views
Last Modified: 2013-10-26
Hi

In an ASP.net web app is it possible to move the position of an image behind a button click?

Thanks
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
...behind a button click
As a postback, or via Javascript? If the former, why would you want to post all the way back to the server just to move the image?
0
 

Author Comment

by:murbro
Comment Utility
Thanks. What JavaScript would I use?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
If you are able to grab this image tag easily then following example would apply

<html>
<head>
<script type="text/javascript">
function changepic()
{
 document.getElementById("demo").style.top=2000 + "px";  
}
</script>
</head>
<body>

<h1>My First Web Page</h1>
<div>
<img id="demp" src="./omna.jpg"  style="position:absolute; left: 400; top: 100; width: 200;      height: 200;"/>
</div>
<button type="button" onclick="changepic()">change pic</button>
</body>
</html>

Open in new window



If not, provide us more information.
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks very much
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now