Jump to content

divinedesigns1
 Share

Recommended Posts

:boredom: i need help making a gallery, a very simple gallery nothing too complicated this is my layout haveimage1 image 2 image 3 image4 and when if you click on image1 it become big with a width of 500*400 and theres a next and previous button and a close button how do i make this in js?
Link to comment
Share on other sites

if images are already loaded in image tag you could use dom to get the array of image (http://w3schools.com/jsref/coll_doc_images.asp) and assign the desired images to array(which will work as holder of your image). or if you are going to get image dynamicaly you can use new Image() to get a new image dynamicaly and append it in array. you need to set a eventhandler on image so that when it is being clicked you can make its widht and height property changed. you need to set a eventhandler on button next and previous so that when it will be clicked a counter will will move back and forth depending upon next and previous. you have to check that counter should be grreater than 0 and lesser than the array length of image holder. after that you can use that counter to use as index to point out a particular image and can do opration on that image.

Link to comment
Share on other sites

alright thanks, didnt fully understand what your saying but ill take a look at the tut first and try it out

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...