You need to sign in to do that
Don't have an account?
Slideshow of images in Visualforce
I want to make a slideshow of images by embedding javascript in visualforce.
I wrote the following code. It shows the same image even after clicking next button. Can anyone tell me how to fix it? thanks
<apex:page showChat="false" sidebar="false" standardController="account">
<apex:pageBlock >
<apex:form >
<center>
<apex:image id="img" value="{!$Resource.one}" width="600" height="400"/>
<br>
</br>
<apex:commandButton value="Next" styleClass="groovybutton" onclick="next();return false;"/>
</center>
</apex:form>
<script>
function next()
{
var img = document.getElementById('img');
img.value= "{!$Resource.two}";
}
</script>
</apex:pageBlock>
</apex:page>
Hi,
Try this piece of code, this works well for me . Let me know if you face any diffculties.
Important :
Hit Kudos [Star Icon ] if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You
All Answers
Hi,
Try this piece of code, this works well for me . Let me know if you face any diffculties.
Important :
Hit Kudos [Star Icon ] if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You
Hi,
I had mistakenly written the first line , Correct is as
<apex:page showChat="false" sidebar="false" standardController="account">
Also , If this is the solution which you were looking for , then please mark it as a solution for others who come in search for the same doubt.
Important :
Hit Kudos [Star Icon ] if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You
Hi Gautam ,
I do have the same requirement ,but if we want to call nearly 10 images in slide as next ,next etc ,then how to call them.
Can u plz help me out .
Thaks in advance
Hi Gautam ,
I do have the same requirement ,but if we want to call nearly 10 images in slide as next ,next etc ,then how to call them.
Can u plz help me out .
Thaks in advance
Rather to make it more dynamic , Try making an array of the images in the code from the Resource and then pass that array instead of the individuals in the code above, this will complete the requirement.