7 Replies - 1191 Views - Last Post: 27 March 2014 - 10:35 AM

#1 freefall315  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 14

Image Gallery Program

Posted 26 March 2014 - 01:22 PM

First of all,I am a complete novice and really appreciate any help that can be given. I didn't not attach any of my code just for the sole reason I'm not exactly sure which portion to post.

What I'm trying to do: I'm writing program similar to pinterest where people can up load pictures of dogs. The pictures are uploaded through paperclip and laid out with J-query Masonary. Right now, when you click on a picture it shows a single picture of the one that was click, then you can hit the back button to go back to the the stream of pictures. What I would like to do is have a user be able to click on 2 pictures and highlight the pictures (with a border, or highlight them, a large check etc) from there both pictures together would move to another page to be compared. I think this could be done with a JS script but I'm not sure.

If you need a portion of the code please just let me know which part and I will be happy to post it. Please be gentle I'm just to learn this stuff.

This post has been edited by macosxnerd101: 26 March 2014 - 01:23 PM
Reason for edit:: Renamed title to be more descriptive


Is This A Good Question/Topic? 0
  • +

Replies To: Image Gallery Program

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,065
  • Joined: 27-December 08

Re: Image Gallery Program

Posted 26 March 2014 - 01:24 PM

Welcome to Dream.in.Code.

So is this a Ruby question? What does this have to do with Ruby? It sounds more like a Javascript question. I am happy to move this to the more appropriate forum.
Was This Post Helpful? 0
  • +
  • -

#3 freefall315  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 14

Re: Image Gallery Program

Posted 26 March 2014 - 01:28 PM

View Postmacosxnerd101, on 26 March 2014 - 01:24 PM, said:

Welcome to Dream.in.Code.

So is this a Ruby question? What does this have to do with Ruby? It sounds more like a Javascript question. I am happy to move this to the more appropriate forum.


I guess it can be moved, just didn't know if there was ruby solution. Thank you
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,065
  • Joined: 27-December 08

Re: Image Gallery Program

Posted 26 March 2014 - 01:31 PM

A word of advice- I would suggest posting your thread in the correct forum to start. If you're working in JS, posting in the Ruby forum probably won't get you the help you need. I'll move this to Javascript. :)
Was This Post Helpful? 0
  • +
  • -

#5 ArtificialSoldier  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 383
  • View blog
  • Posts: 1,383
  • Joined: 15-January 14

Re: Image Gallery Program

Posted 26 March 2014 - 04:29 PM

How you want to actually implement that would be up to you, but yeah of course it's possible. One way might be to have a checkbox for each picture, with a button to compare them. The button would run a function that would figure out which of the boxes are checked, gather the image URLs (the URLs could be the checkbox values), and build a URL to the compare page that has the selected image URLs in the querystring. The compare page would get the URLs from the querystring and show the images.

Another way might be where you just click on the images, which would replace the current click functionality of opening the one image. When someone clicks on an image it would run a function that would have a counter of how many images have been clicked. If the counter is 0 then it would just save the clicked image URL and set the counter to 1. If the counter is 1, where they have already clicked an image, then it would get the URL for the second image, retrieve the saved URL for the first image, and open the compare window.

I'm sure you can think of other ways to design that, those are just a couple that spring to mind.
Was This Post Helpful? 0
  • +
  • -

#6 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 439
  • View blog
  • Posts: 1,865
  • Joined: 30-April 10

Re: Image Gallery Program

Posted 26 March 2014 - 09:39 PM

This is what I would do,

When the user is holding shift and clicks an image it will save the url to the image in an array and add a selected class to the image that will give it a small border, then once the user is done selecting photos they can click a button that will send the user to the compare area of the site.

There are plenty of ways to get this done, you need to decide the design for yourself.
Was This Post Helpful? 0
  • +
  • -

#7 freefall315  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 14

Re: Image Gallery Program

Posted 27 March 2014 - 10:27 AM

View Postmacosxnerd101, on 26 March 2014 - 01:31 PM, said:

A word of advice- I would suggest posting your thread in the correct forum to start. If you're working in JS, posting in the Ruby forum probably won't get you the help you need. I'll move this to Javascript. :)/>



Got it, thank you
Was This Post Helpful? 0
  • +
  • -

#8 freefall315  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 14

Re: Image Gallery Program

Posted 27 March 2014 - 10:35 AM

View PostArtificialSoldier, on 26 March 2014 - 04:29 PM, said:

How you want to actually implement that would be up to you, but yeah of course it's possible. One way might be to have a checkbox for each picture, with a button to compare them. The button would run a function that would figure out which of the boxes are checked, gather the image URLs (the URLs could be the checkbox values), and build a URL to the compare page that has the selected image URLs in the querystring. The compare page would get the URLs from the querystring and show the images.

Another way might be where you just click on the images, which would replace the current click functionality of opening the one image. When someone clicks on an image it would run a function that would have a counter of how many images have been clicked. If the counter is 0 then it would just save the clicked image URL and set the counter to 1. If the counter is 1, where they have already clicked an image, then it would get the URL for the second image, retrieve the saved URL for the first image, and open the compare window.

I'm sure you can think of other ways to design that, those are just a couple that spring to mind.



Thanks, I'm going to try both of these and see how it goes, appreciate the input

View Postlaytonsdad, on 26 March 2014 - 09:39 PM, said:

This is what I would do,

When the user is holding shift and clicks an image it will save the url to the image in an array and add a selected class to the image that will give it a small border, then once the user is done selecting photos they can click a button that will send the user to the compare area of the site.

There are plenty of ways to get this done, you need to decide the design for yourself.



Thanks I appreciate the help
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1