Displaying Image in ASP.NET AJEX
-
Hello sir Thanks for your rep. sir I dont know JS and C# so any other help I have tried to change this to vb but i am bit strugling with 2 things 1- setInterval(changeImage, 250); 2- img.src = waiting for your kind rep. thanks
A slight modification :
var imageNum = 1;
setInterval("changeImage()", 250);
function changeImage()
{
if( imageNum >= 16 )
imageNum = 1;imageNum = parseInt(imageNum) + 1;
img.src = "http:\\mysite\" + imageNum + ".png";
}Use this javascript to your page inside <script> tag. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml> -
A slight modification :
var imageNum = 1;
setInterval("changeImage()", 250);
function changeImage()
{
if( imageNum >= 16 )
imageNum = 1;imageNum = parseInt(imageNum) + 1;
img.src = "http:\\mysite\" + imageNum + ".png";
}Use this javascript to your page inside <script> tag. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml> -
A slight modification :
var imageNum = 1;
setInterval("changeImage()", 250);
function changeImage()
{
if( imageNum >= 16 )
imageNum = 1;imageNum = parseInt(imageNum) + 1;
img.src = "http:\\mysite\" + imageNum + ".png";
}Use this javascript to your page inside <script> tag. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml>Abhishek Sur wrote:
imageNum = parseInt(imageNum) + 1;
Why? imageNum is already integer. Also, since imageNum is initialized as 1, parseInt(imageNum) + 1; would make it off by one.
only two letters away from being an asset
-
Thanks for your rep. but still I am not getting any ware as i dont know JS i copy and past between code but there are blue lines and i my assignment is asp.net using visual basic waiting for your kind rep. have a nice day
<html> <script> var imageNum = 1; setInterval(changeImage, 250); function changeImage() { if( imageNum >= 16 ) imageNum = 1; img.src = "http:\\mysite\" + imageNum + ".png"; } </script> <body> etc You have been given everything you need. Now, you really need to pick up a book and learn something about html and javascript on your own.
only two letters away from being an asset
-
Thanks for your rep. but still I am not getting any ware as i dont know JS i copy and past between code but there are blue lines and i my assignment is asp.net using visual basic waiting for your kind rep. have a nice day
You have been given a copy and paste solution. If you still can't make it work, or understand it, that indicates your level of competence is too low to be able to use good help. Which is your problem. Buy a book and read it, then come back.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You have been given a copy and paste solution. If you still can't make it work, or understand it, that indicates your level of competence is too low to be able to use good help. Which is your problem. Buy a book and read it, then come back.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
What's the expression? We can make it idiot proof, but they keep making better idiots. :rolleyes:
only two letters away from being an asset
-
Abhishek Sur wrote:
imageNum = parseInt(imageNum) + 1;
Why? imageNum is already integer. Also, since imageNum is initialized as 1, parseInt(imageNum) + 1; would make it off by one.
only two letters away from being an asset
-
Abhishek Sur wrote:
imageNum = parseInt(imageNum) + 1;
Why? imageNum is already integer. Also, since imageNum is initialized as 1, parseInt(imageNum) + 1; would make it off by one.
only two letters away from being an asset
Well Mark, I agree, parseInt is not necessary.. I just used this for security purpose. But if you dont increment imageNum, how could it change the image? I think it should load 1.png, 2.png and so on... isnt it. :)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml> -
Well Mark, I agree, parseInt is not necessary.. I just used this for security purpose. But if you dont increment imageNum, how could it change the image? I think it should load 1.png, 2.png and so on... isnt it. :)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml>True, I forgot. My response has been edited. The increment should be after the imageNum is used.
Abhishek Sur wrote:
I just used this for security purpose.
Explain?
only two letters away from being an asset
-
True, I forgot. My response has been edited. The increment should be after the imageNum is used.
Abhishek Sur wrote:
I just used this for security purpose.
Explain?
only two letters away from being an asset
Mark Nischalke wrote:
Explain
Might be if somebody initializes it with "" .. or using some existing variable which is having value as character... (Not in this code ;) ):rose:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml>