Placed in: Home arrow Programming arrow Webdesign arrow Creating a polaroid photo viewer with CSS3 and jQuery
Creating a polaroid photo viewer with CSS3 and jQuery

Italy. A beautiful country that my girlfriend and me visited last year during our summer holiday. While we were there, we took a lot of pictures that would look pretty nice on polaroid.

Placing them on simple polaroids on a webpage simply didn't do it for me. I wanted to drag them around, rotate them and still have a fun time. That's were CSS and jQuery come in play. By combining the CSS3 Box Shadow and Rotate properties, this effect is relatively easy to create. When dragging a polaroid around, you'll see the shadow. When it's placed down, it's rotated to the left or the right (random).

Polaroid Photo Viewer with CSS3 and jQuery

This example is making use of CSS3 and jQuery, just to show the effect when combining two powerful techniques. The CSS3 is injected by jQuery, keeping the CSS file clean.

Demo polaroid photo viewer with CSS3 and jQuery   Download polaroid photo viewer with CSS3 and jQuery

IMPORTANT NOTE:
Sadly, CSS3 and HTML5 aren't the standards (yet) these days (when will it ever be?). Since this demo is using CSS3, not all modern browsers will be able to show off the full effect. Because of this, it only works on Apples Safari and Google Chrome as they are the only browsers supporting the Transform and Box-Shadow property of CSS3 via the -webkit- prefix. Mozillas Firefox 3.1 is getting these properties too (with the -moz- prefix). So, for now, this is just for fun - Other browsers will display the polaroids, but won't have the neat shadow while dragging and rotating while placing them down.

With that said, check out how you can re-create this effect and learn some more about CSS3 and jQuery. Check out one of my older articles if you're searching for an image gallery that isn't using CSS3.

Just for the record: Not all pictures were taken by me (just some of them). Most of them were from stock.xchng.

Safari Demo

Check out this small video I placed on YouTube, showing this effect in full glory (rotating and adding a shadow while dragging).

HTML

The HTML of this page isn't really hard to understand.

 
<div class="polaroid">
  <img src="images/01_colosseum.png" alt="Colloseum" />
  <p>Coloseum in Rome</p>
 
</div>
<div class="polaroid">
  <img src="images/02_vatican.png" alt="Vatican" />
  <p>Vatican</p>
</div>
<!-- More images here -->

The polaroid-class is the container of the polaroid. The next element (img) is the picture, the element after that (p) is used for the caption below the image. Repeat this as many times as you want with all your polaroids!

CSS

Just like the HTML, the CSS part of this example is pretty simple.

 
.polaroid { width:368px; height:376px; background-image:url(../images/polaroid-bg.png); position:absolute; }
.polaroid img { width:335px; height:275px; margin:25px 0 0 15px; }
.polaroid p { text-align:center; font-family:Georgia,serif; font-size:20px; color:#2E2E2E; margin-top:15px; }

Note that polaroid-class has a fixed width and height (Same size of the background image). It's also placed on an absolute position. The img of the polaroid has also been moved to a fixed position. The caption is aligned to the center.

jQuery and CSS3

Now for the real fun! The HTML and CS weren't so interesting, now this is going to be. I'll split the code in several parts and make sure you read the comments in the code.

 
google.load("jquery", "1.3.1");
google.load("jqueryui", "1.7.0");

I'm using Googles JavaScript Libraries API to load jQuery and the jQuery UI. We're going to need the last one for the jQuery UI Draggable Component for dragging the polaroid around.

 
   // Set the Z-Index (used to display images on top while dragging)
   var zindexnr = 1;
   
   // boolean to check if the user is dragging
   var dragging = false;
   
   // Show the polaroid on top when clicked on
   $(".polaroid").mouseup(function(e){
      if(!dragging) {
         // Bring polaroid to the foreground
         zindexnr++;
         var cssObj = { 'z-index' : zindexnr,
         '-webkit-transform' : 'rotate(0deg)' };
         $(this).css(cssObj);
      }
   });

The zindexnr variable is used to "remember" the z-index. Every time a polaroid is clicked, the z-index is added by one, making the polaroid come to the foreground. The dragging boolean is to determine if the user is dragging the polaroid, or just clicking on it. When clicked (like in this part of the code), the polaroid is rotated to it's original position (zero degrees) and placed on top.

I actually made this method to "zoom in" to the polaroid, but removed it later on. If you still want to zoom in, simply add your code in that function.

 
   // Function to get random number upto m
   // http://roshanbh.com.np/2008/09/get-random-number-range-two-numbers-javascript.html
   function randomXToY(minVal,maxVal,floatVal) {
      var randVal = minVal+(Math.random()*(maxVal-minVal));
      return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
   }

The function that you see above is to generate a random number between two integers. I added the source URL where I got the function from; We'll need it in the next part of the code:

 
   // Make the polaroid draggable & display a shadow when dragging
   $(".polaroid").draggable({
      cursor: 'crosshair',
      start: function(event, ui) {
         dragging = true;
         zindexnr++;
         var cssObj = { '-webkit-box-shadow' : '#888 5px 10px 10px',
            'margin-left' : '-10px',
            'margin-top' : '-10px',
            'z-index' : zindexnr };
         $(this).css(cssObj);
      },
      stop: function(event, ui) {
         var tempVal = Math.round(Math.random());
         if(tempVal == 1) {
            var rotDegrees = randomXToY(330, 360); // rotate left
         } else {
            var rotDegrees = randomXToY(0, 30); // rotate right
         }
         var cssObj = { '-webkit-box-shadow' : '',
            '-webkit-transform' : 'rotate('+ rotDegrees +'deg)',
            'margin-left' : '0px',
            'margin-top' : '0px' };
         $(this).css(cssObj);
         dragging = false;
      }
   });

Let's break this up a little bit.

  • $(".polaroid").draggable( - Needed for jQuery UI to make the element draggable.
  • start: function(event, ui) - This is called when the user starts dragging and the shadow is needed.
  • '-webkit-box-shadow' : '#888 5px 10px 10px' - Added to inject the CSS3 "box-shadow" property.
  • $(this).css(cssObj); - Adding the CSS to this, which is the polaroid.
  • stop: function(event, ui) - This is called when the user stops dragging and the shadow is removed, including a rotation.
  • var tempVal = Math.round(Math.random()); - Generating a random number (1 or 0), needed to rotate the polaroid left or right.
  • var rotDegrees = randomXToY(330, 360); - Generating a random number between 330 and 360 to rotate the polaroid to the left.
  • var rotDegrees = randomXToY(0, 30); - Generating a random number between 0 and 30 to rotate the polaroid to the right.
  • '-webkit-box-shadow' : '' - Removing the shadow.
  • '-webkit-transform' : 'rotate('+ rotDegrees +'deg)' - Rotating the polaroid based on the randomly generated degrees.

That's about it! I also added a function that randomly scatters the polaroids when everything had loaded and tadaa: An awesome polaroid photo viewer with CSS3 and jQuery.

Conclusion and Download

Hopefully CSS3 will become the standard quick and users will kick out the old browsers too. This way, this technique would be pretty awesome to be used to display some crazy photo galleries. It's relatively simple to achieve, still the effect is pretty powerful. It's really fun too!

Demo polaroid photo viewer with CSS3 and jQuery   Download polaroid photo viewer with CSS3 and jQuery

I hoped you learned something today about CSS3 and/or about jQuery. Do you think this could be useful somewhere or that you're going to use it in the future? Or do you want to improve the code by adding the zooming functionality when the user clicks on the image? Please share!

UPDATE

For those people that are interested in a non-full screen version of this script, I just released it too.


Tags:  polaroid photo viewer css3 jquery tutorial webdevelopment

Interested in this topic? You might enjoy another article I've written called

Did you like this article? Subscribe to my feed or email to keep updated on new articles.

Spread the word and submit to:
Digg!Reddit!Del.icio.us!Facebook!StumbleUpon!
Comments
Add NewSearchRSS
Gaya - nice   2009-03-16 21:38:13
Gravatar image Looks good Marco =D, really nice use of Javascript.

I hate the fact that not all browsers are implementing the rules, making it almost useless to put on your website as a nice rich application.
Damn the browsers. It would be so easy for us if there was 1 good standard which HAD to be implemented, or else the browser wouldn't be allowed online.
We can only dream.
Marco - Thanks Gaya!   2009-03-16 21:45:03
Gravatar image Thanks for the reply mate!

Also check the JavaScript file in the demo and search for the following:
Quote:
// Internet Explorer doesn't have the "window.innerWidth" and
"window.innerHeight" properties

I'm really sorry for that mega-ugly "fix", but IE only allows checking the browser width & height after the BODY tag.

Damn you Microsoft!
Remco - Opera   2009-03-17 00:11:05
Gravatar image Works like a charm in Opera 9.6x of course :)
Marco - Thanks! Didn't know   2009-03-17 07:16:41
Gravatar image Hi Remco,

Thanks for checking it with Opera - Didn't test that browser. Didn't expect to "not work" in that one ;) .

I do have one question:
Is it because I added the "box-shadow" (plain) CSS3 property in the JavaScript file, or is it because of the "-webkit-" prefix (which means that Opera is using the Webkit engine too)?
Vladimir - Click   2009-03-17 09:23:46
Gravatar image very good, but they are not clickable :(
Marco - They are!   2009-03-17 13:32:21
Gravatar image Actually, they are. Check the article and read the JavaScript examples from
Quote:
$(".polaroid";).mouseup(function(e){

Currently, "zooming in" isn't added, but can be if you just modify that function ;). Now, when you click a polaroid, it just rotates back to zero degrees and placed on top :) .
Hezi - Kudos!   2009-03-17 09:43:10
Gravatar image very very nice!

Remco - you rock!
Marco - Remco? Marco?   2009-03-17 13:45:33
Gravatar image Thanks for the compliment Hezi ;) ! I assume that you complemented me (my name is Marco)? Or did you compliment Remco for testing in Opera?
Janko - Bravo!   2009-03-17 13:28:12
Gravatar image Awesome example, Marco. Good idea to make an example video.
Marco - Thanks!   2009-03-17 13:33:52
Gravatar image Thanks Janko! Yeah - The example vid is for IE and FF users (FF will have to wait a while, IE even longer).

Like you said in the email: You could also retrieve your FlickR API using JSON to fill in the polaroids using your FlickR images ;) !
Tom Sinclair   2009-03-18 16:15:05
Gravatar image Great tutorial :) Will definitely have a play around with this later!
Karis   2011-05-14 11:55:44
Gravatar image Nice.. i agree with you
ben smithson - Wicked Awesome   2009-03-19 01:59:21
Gravatar image This is gah-hhhreat! Loving the drag n drop images.
Thanks for a great post!
Will B. - How do you rotate?   2009-03-30 21:56:20
Gravatar image Didn't quite figure out how to rotate the images, though.
Marco - CSS Transform   2009-03-30 22:23:59
Gravatar image The CSS "transform" property allows you to rotate elements.
Quote:
img { '-webkit-transform' : 'rotate(100deg)' }

This will rotate all images with 100 degrees. This only works for browsers supporting the -webkit- prefix (Safari & Chrome).

Hope this helps!
not2comply   2009-03-31 10:08:59
Gravatar image Eventhough CSS3 isn't fully supported by some browser, I found myself unable to stop playing with CSS3.

And this one is totally Awesome...

Great Work. and thanks for sharing.
Marco - Thanks!   2009-03-31 16:56:00
Gravatar image The same counts for me - CSS3 has way to many awesome feautures to be put to the side.

Hopefully that CSS3 will be the standard "soon" so Flash website will be completely obsolete and codes will have more ease in creating fancy stuff on a website.

Thanks for your comment!
Anthony - Thank You!   2009-03-31 21:01:25
Gravatar image This is one of the best JavaScript examples I have ever seen.

Thanks
stack - Shadoooows   2009-04-02 17:45:49
Gravatar image for a better shadow, stack transparent layer and for each moveto x+10 and y+10 !
know what i mean ?
Marco   2009-04-02 18:19:10
Gravatar image Yeah - you're right. You could append another div with a transparent background image that would move to x+10 and y+10. This solution will make it cross-browser compatible.

But that wasn't where this article was aiming to - It was about the awesomeness of CSS3 and what you can do with it ;) . That's why I choose the CSS3 box-shadow property.

Anyway, thanks for your input - Always appreciated!
Henry - I like it   2009-04-02 21:08:29
Gravatar image Really I like it. Congratulations.
Cyrus - Fixed bg needed   2009-04-05 11:08:14
Gravatar image The ui is nice. Can anyone help me out how to fix the width and height up to which a specific picture is expandable.

I tried using background:no-repeat. but didn't seem to work for me.

Thanks.
Marco - What?   2009-04-05 21:11:58
Gravatar image Hi Cyrus,

Thank you for your comment.

What do you mean with "specific picture is expandable"?

If you can't explain it in the comments, please contact me so we can discuss this further.
Cyrus - Background fixed   2009-04-12 16:38:12
Gravatar image Background was fixed by adding this two property to polaroid draggable

containment: '#containment-wrapper',
scroll: false,

Thanks.
Cody - Flickr   2009-04-14 04:45:45
Gravatar image Will there be a version with flickr integrated into it?
Marco - Could be!   2009-04-16 07:43:22
Gravatar image Hi Cody,

Thanks for your comment.

I don't know if there will be a FlickR version, but thanks for the idea. Just keep on checking this website for more updates and I might give it a shot!

Greetings,,
Blog Seo - En explorer 8 si funciona   2009-04-20 12:09:55
Gravatar image :woohoo: Increible, pero en Explorer 8 si que funciona la galeria..

Gracias por el aporte ...

Saludos

Dbarrera
Tran Ngoc Hieu - Blue Sky   2009-05-06 08:50:10
Gravatar image See very beautyful
very cool
thank
Pawan   2009-05-12 12:07:05
Gravatar image :angry:

Firefox 3 ... "The best web browser .. lol " ... does not gives scroll bars also when running this example.. IE atleast provide the scroll bars..
Pawan   2009-05-12 12:08:18
Gravatar image :)
but.. ya.. amazing example... and that should be the point of discussion...
thanks
Tom - No Fullscreen   2009-06-04 18:33:51
Gravatar image Very nice script, compliment! But, is it somehow possible to reduce it into a div and not to have it allways fullscreen?
Josh   2009-08-07 22:38:32
Gravatar image I want to know the same thing.
JAMES Gray - In div container   2009-08-11 05:40:48
Gravatar image Hi - Great script - I'm also trying to container the gallery in a div - has anyone worked a solution?
Marco - Working on it   2009-08-12 01:51:30
Gravatar image Hi people,

Thanks for the comments. I'm currently working on a version "inside" a div-container. Simply keep an eye on the homepage of Marcofolio, since it'll be released there.

Greetings,,
Marco - Done!   2009-08-12 16:14:52
Gravatar image Done!

The new script has been placed online.

Good luck with that folks!
James Gray - THANKS MARCO!   2009-08-13 02:34:58
Gravatar image Thank you so much Marco - where do we donate!
Marco - No problem!   2009-08-13 06:01:59
Gravatar image No problem - glad I could help some people out.

You don't need to donate - simply visit Marcofolio.net a couple of times / leave some comments and feedback, that's all I need.
robb   2009-07-18 22:05:54
Gravatar image nice tutorial.
thx for sharing
martin - thank you   2009-07-27 17:52:34
Gravatar image thank you for sharing. i like this tutorial and the effects are great!
good work!
Efe - Thanx   2009-08-01 13:07:43
Gravatar image thanx , good work!
Arrow - Permision   2009-08-10 17:29:19
Gravatar image May I use this script in comertial project?
What caind of license this script is?
Marco - Yes, but..   2009-08-11 02:07:47
Gravatar image Everything that is released on Marcofolio.net is released under a CC3.0 license. This means you can use this work when and where-ever you want it, as long as you tell who the original author was (Marcofolio.net).
Arrow - permission - cd   2009-08-11 12:29:42
Gravatar image nice:P but what will be when I will change some code? (css, html, another design??)
Is it no problem when I still leave message in css, javascript file that Marcofolio.net is original author??
Marco - Correct   2009-08-12 01:50:46
Gravatar image Yup - you're correct. Simply leave a message in the CSS/JS etc. that looks something like "original author.." and "modified by.."

Good luck!
Ytrog - Nice   2009-08-12 12:22:22
Gravatar image Nice app.

I'm not sure though that a Creative Commons licence is the best choice for software. From what I understand it is more or less meant for things like pictures or text. Wouldn't GPL or LGPL be more appropriate in this case?
Ytrog - Addition to last post   2009-08-12 12:23:44
Gravatar image I forgot to mention it works on Firefox 3.5 ;)
Arun V - Nice Work   2009-08-20 08:13:53
Gravatar image Hey Man, I Found your Works, Nice Works, Good..

Thanks

Arun
BCmoney - Adding new photos...   2009-09-16 03:00:43
Gravatar image I was able to add new photos to the DOM but it makes the polaroids undraggable. I first put all the polaroids in one parent "polaroids" div, then used the following simple DOM addition:

Code:

function addPolaroid(polaroidName,imageURL)
{
top.window.document.getElementById('polaroids').innerHTML+=""+polaroidName+"";
}


I think it's probably something to do with innerHTML putting HTML on the page but not actually into the DOM... maybe we need to use createElement + appendChild?

Will dig into the code more but just thought I'd check if you know offhand why adding one more polaroid renders every polaroid undraggable.

Thanks for a wicked JS image gallery!
selva comments - Comments - Good work..   2009-09-21 12:28:24
Gravatar image We liked it very much. We were looking for integrating the same in our website
bTop - Very nice.   2009-09-28 21:34:00
Gravatar image Hi, it's amazing! I like this. <img src=hock:' />
bTop - Very nice.   2009-09-28 21:34:49
Gravatar image <img src=hock:' /> Hi, it's amazing! I like this.
Lurker   2009-10-22 00:09:45
Gravatar image Works great in Safari. However this blog page doesn't. The text runs off the edge of the white area.
Anonymous - good   2009-11-09 09:46:52
Gravatar image Oh my god. I just know that Safari colud do this. Thank you for your share.
tuna - good tutorial   2009-11-10 23:15:56
Gravatar image it is good and interesting..
arthas   2009-12-21 04:58:47
Gravatar image hi marco..

hats off to you..seriously you have done a great job. :lol: .i am in ny 2nd year college and neede this type of effect for my project...thanx to you...if u dont mind can i have your email id..i may refer to you later for other effects..
saiful103a - hi   2010-01-08 20:59:06
Gravatar image have downloaded your code... and bookmarked... :)
Danny - Glow version of Polariod   2010-01-10 01:35:07
Gravatar image Hi Marco,

Just to let you know I have ported your excellent polaroid jQuery example to the BBC's Glow library. I have a demo running at http://demos.bizlinx.net/polaroid

Cheers for the inspiration.

Danny.
elliot condon - Firefox   2010-01-26 01:32:03
Gravatar image The code you have written is great!

You wrote it with Safari in mind. But it can work with Firefox as it too supports the rotate css3 functionality.

When ever you see this line of code:
'-webkit-transform' : 'rotate('+ rotDegrees +'deg)', // safari only

add this line after it
'-moz-transform' : 'rotate('+ rotDegrees +'deg)', // firefox :)
Anonymous   2010-02-11 02:48:24
Gravatar image Wow! So cool effect! very nice ..
I love this site.
Errik - Amazing   2010-02-21 03:28:07
Gravatar image Best jquery image effects i ever seen you're amazing dude ;)
movie - hi   2010-03-05 16:34:53
Gravatar image it is good and interesting.. amazing amazing B) B)
Steve Sucker - Safari is made for monks   2010-03-12 15:36:57
Gravatar image fuck apple which does not confirm to w3c rules!!
Chris - Trying to implement code within a DIV   2010-03-24 13:04:19
Gravatar image Hi,

Ive implented your code to my website which looks great. However, I want the images to be only contained within my 'maincontent' div so they are unable to move all over the page.

Does anyone know which bit of code I need to change/add for me to do this?

Thanks in advance.

Great code by the way!
Marco - Already released it!   2010-03-24 19:26:20
Gravatar image Hi Chris! It's already released on this site: The Polaroid Photo Viewer - Non-Full Screen. Good luck!
Large Format Printing   2010-04-17 14:29:20
Gravatar image It's really very good and interesting. Liked your post very much. Hope to see your post again.
Fireworks   2010-04-19 07:55:55
Gravatar image Wow, really impressed with this post, will add you to my rss feeds, good work!
pdigi   2010-05-04 20:06:23
Gravatar image Wow! Cool effect! very nice ..
I love this site.
Thanks.
Kristin   2010-05-13 19:04:37
Gravatar image Is there a way to make the image have a lightbox effect so that when you click on it the image would become bigger?
boat   2010-05-14 14:48:15
Gravatar image Cool Site
Thanks
Mike - web design surrey   2010-05-19 17:12:08
Gravatar image This is a great example. Please Please make a wordpress plugin from this , or any wordpress coders turn it into a plugin!!!
ai   2010-06-07 09:50:37
Gravatar image cool post ! the best JavaScript very useful
Marco Barbosa   2010-06-14 10:51:29
Gravatar image Haha and I just wanted to do exactly this to my portfolio.

Very nice! Thanks for sharing.
Anonymous - movieinw   2010-06-17 10:48:17
Gravatar image This is so interesting. Very userfull for veryone. I just no such thing about java.
Thank again
Anonymous   2010-06-17 10:50:17
Gravatar image I agree with all people that this is a great post. Give a lot of knowledge for me. Thank
Anonymous   2010-07-20 17:27:03
Gravatar image im newbie in coding...

how can i change code in google.load("jquery"...)etc...
i want to remove it so i can see your work even if i am not connected through internet...

for some reason...it is not loading because of the google things...
how can i load it.?

waiting for your responce....

anyway...great work :)
siammusicz - good post   2010-08-04 08:14:06
Gravatar image Oh my god. I just know that Safari colud do this. Thank you for your share.
thaitv - good idea for me   2010-08-14 23:07:05
Gravatar image thanks for post.
i just get this idea that apply for my website.
Thank you so much.
movieinw   2010-08-24 15:50:39
Gravatar image I try to write the CSS code many time. but still got some error. Thank you for your css code
Natalie   2010-08-25 17:47:29
Gravatar image Thanks for sharing! I'm trying to use some of this now. I'll share a link when I finish!
Natalie   2010-08-25 19:37:18
Gravatar image I have it working but my background image isn't showing up... Any ideas what I am missing?
Michael   2010-08-27 19:19:57
Gravatar image Thanks for the good stuff. Those are really useful for me...
kenny - thanl   2010-09-01 04:48:37
Gravatar image Cool Site. verry useful...becuase ^___^ free!!! infor
Thanks
kenny   2010-09-01 04:49:33
Gravatar image thank a lot
second hand - second hand   2010-09-27 15:48:07
Gravatar image the best JavaScript examples . so helpful
nice post with thank you
second hand - second hand   2010-09-27 15:48:53
Gravatar image anyways thank a lot
Somer Jardine - sonic producer   2010-09-28 09:00:52
Gravatar image :) :lol: :D Great staff... Thanks for sharing some helpful information... Because of reading your post and analyzing it, I'm trying to use some of this now. And its nice and good... Thanks for sharing :)
Michael Lopez - Buy Pregnancy Miracle   2010-10-05 11:40:32
Gravatar image Nice listing! Thanks for the information!.. Great staff! And great source too... and the comments too... Cheer up!

And also before i forgot, Emma, I will try to visit that site... hope too see additional info!
Udo Schmitz - This is what I did with it   2010-10-13 19:44:58
Gravatar image Many thanks for the polaroid viewer. I use it for my portfolio:

http://www.udo-schmitz.de

I (with help from others) did some work on it, to make it work in Internet Explorer as well (using jquery.transform-0.8.0.min.js), and changed some css values to make the shadow more naturalistic. There is just one bug left in IE: If you click on a polaroid, IE is putting it back in the upper left corner, where the picture was loaded in the beginning.

The author of jquery.transform is talking about this problem here:

http://github.com/heygrady/transform/wiki/correcting-transform-origin-and-translate-in-ie

"IE kind of locks the transform origin at 0, 0"

But I don't know enough about Javascript to fix that on my site.

Tell me what you think :)
Dennis Roeling - firefox bug   2010-10-28 07:44:03
Gravatar image Hi Marco,
first, thanks for this great code:D

But i have question.

I am working with a content which is 70% of the page right in de middle. In it loads the images in de content, but in firefox the pictures also appear on the right side of this contentbox.

Do you know how to fix this?

I hope to hear from you soon!

Dennis
Rachael Lancaster - Just what I was looking for...   2010-10-29 15:24:52
Gravatar image But,
I was wondering if there's a way to constrain the positioning of the images.
I'm working within Divs, and need to have the pictures show in a (e.g.) 400x400 px window.

Will have another look at the code and try to get it working - but wondered if there was a nice simple solution!

Thanks again - and great script!
Rachael
Rachael Lancaster - Found it!   2010-10-29 15:28:21
Gravatar image var cssObj = { 'left' : Math.random()*(wiw-400),
'top' : Math.random()*(wih-400),

Duh!!
Should have looked at the code properly before posting.

Again - brilliant work - looking forward to my finished result!
Rafael - Woow Photo!   2010-11-15 09:15:46
Gravatar image nice tutorial.
thanx , good work! ;)
Pat - Great but zomm ?   2010-11-16 10:38:52
Gravatar image Hi there!
That polaroid viewer is just great!
But could you help me to change the code to zoom on pictures when you click on one of them.
I am no javascript coder so I don't know what to do... :confused:
Thank you!

Pat.
Patel - Overlap issue   2010-11-29 15:41:11
Gravatar image Hi Marco
This is very cool gallery. right Gallery picture is overlap with each other, is there way to stop or reduce overlapping? Is there anyone know about how to that?
tong   2010-12-09 06:05:42
Gravatar image This is very cool gallery. right Gallery picture is overlap
Lina Atkinson - Fat Burning Furnace   2010-12-24 11:15:50
Gravatar image I am building a website with a Polaroid Photo Viewer. But the images aren't able to move. Can someone help me out here. I am totally noob at this.
Roel Vliegen   2010-12-24 14:15:45
Gravatar image Which browser are you using?
Maybe I can help.
When using IE comment the
Code:
'padding-left' : '-4px',
'padding-top' : '-4px',

by placing 2 slashes before it in the script.js file.
Roel Vliegen - Asome scripting   2010-12-24 13:12:41
Gravatar image Hey Marco,

you did a great job building this script and sharing it with the world.
I made it compatible with SQL so images can be uploaded by users.
It requires just some minor changes to make work since you've used plain html for selecting the images and thier comments.

There are just some things I would like to add/change. Maybe you or some of the viewers here could give me an hint.
- I would like to have the images more spread out inside the div (i'm using the non-fullscreen version)
- Secondly I would like to add an zoom function when clicked. I read that you'd originally had this function included but removed it later on

All togeether great script and great site with more great scripts.
Anonymous   2010-12-26 15:03:04
Gravatar image Awesome example, Marco. Good idea to make an example video.
i love it so much. thank you for your post
Anonymous - ai   2010-12-26 15:04:53
Gravatar image i will come back a gain
Anonymous   2010-12-31 17:14:27
Gravatar image give you 1+ thank for share. like your post because it is helpful to me
Cgbaran - Great;)   2011-02-03 18:18:18
Gravatar image Great tutorial thanks
Anonymous   2011-02-24 08:26:45
Gravatar image I just learn to use CSS creator. Thank you for you tip.
amy - cheap clothes online   2011-03-14 02:58:31
Gravatar image You have a quite different idea,It sounds really amazing !
New Life Nutrition - Goo write-up :)   2011-04-13 00:21:53
Gravatar image :) This web site is truly intriguing. You deliver way up some good details regarding your own write-up
Atif - Best Writer   2011-04-30 06:11:41
Gravatar image Excellent Tutorial to see here - Thanks
jacker - Brilliant.. unfortunately...   2011-05-01 13:24:24
Gravatar image I'm not.
I thought I'd got it working perfectly, then for some unknown reason when I move the mouse up.. the pictures goes down. could it be because the table I'm trying to use it inside of is defined in % rather than pix?
Chellios - Thanks   2011-05-10 22:55:32
Gravatar image Thanks for sharing. That is a really cool interactive idea for photos. Cheers.
Ann   2011-05-24 11:21:33
Gravatar image :woohoo:
Css Tips   2011-05-25 11:00:22
Gravatar image :) Work superb in all modern browsers also your demo is so good and inspirational thanks for sharing.
Anonymous - Css Tips   2011-05-25 11:02:59
Gravatar image :) Work superb in all modern browsers also your demo is so good and inspirational thanks for sharing.
kamera - kamera   2011-05-28 13:12:32
Gravatar image thnk kamera
Anonymous   2011-06-02 21:18:47
Gravatar image Thank you for teaching. :woohoo:
Lillian   2011-06-04 06:20:42
Gravatar image Thanks for great post...
Lillian(dissertation help)   2011-06-04 06:21:55
Gravatar image what a great site...
i really like it
Edd Tillen - IE9 Compatibility   2011-06-05 17:11:21
Gravatar image Hi Marco, I love this effect, and I would have hoped that 2 years on CSS3 might have been embraced by the likes of IE9. However, although I'm making the effect work perfectly in Chrome, it's not doing anything in IE9. Have they actually taken a step backwards in IE9? I seem to remember this working in IE8 (not perfectly, but at least you could move the photos around, they just wouldn't rotate or have a shadow), now they won't even move around. I'm sure it's not just me, as I've tried your example and a couple of other people attempts on here in IE9 with no luck.

But if it is just me, and I hope it is, does anyone know how it can be fixed.

Thanks
Mieli - ASF   2011-06-11 08:47:07
Gravatar image Thanks Macro :cheer:
manadvd.com - Great tutorial thanks   2011-06-18 11:51:45
Gravatar image Great tutorial thanks
Tyler - awesome   2011-06-29 02:58:33
Gravatar image Awesome. Exactly what I was looking for. I noticed you did this awhile ago. Funny I'm just finding it. Thanks Marco :lol:
movieinw - movie online   2011-07-03 15:56:50
Gravatar image Great tutorial!!. Thank a lot :lol:
Anonymous - Movie Online   2011-07-22 02:37:00
Gravatar image Hello Guy Very impressive. going to try this out now.

Visit to my website Movie online.

Thank you.
Anonymous - Movie Online   2011-07-22 02:37:36
Gravatar image Good tutorial thanks
cheap timberland boots for men - http://www.timberlandonsales.com/featured_products   2011-07-27 13:41:46
Gravatar image Thank you to tell us so useful information.It is very useful for us.Thanks so much.
hirmani80 - WebHostingPad Review   2011-08-02 08:49:27
Gravatar image It is very much satisfied by the info in this blog and the nice technology is visible in this blog. I am very much satisfied by the info in this blog. Thanks a lot for sharing the nice info in this blog
bugsy   2011-08-03 15:02:45
Gravatar image really nice specially in webkit browser where it has that nice swift rotation. I don't know why , but not even firefox 5.0 hasn't got motion.(although they are click and dragable)
michael - Polaroid Photo Viewer   2011-08-04 18:57:32
Gravatar image :angry: Using the google.jquery 1.3.1 nd 1.7.0 when i try to load this on my browser the images just stay on one side
Wedding Photographer - Wedding Photographer   2011-08-04 21:23:18
Gravatar image It is really Excellent work. I appreciate you.
Jerry - Excellent Work   2011-08-05 15:16:22
Gravatar image My complimetns to you Marco...Very nice work and excellent javascript example.

I wonder if the pictures in the polaroid background could be opened with a lightbox effect? That woud really bring out the best of this viewer!!!
profilo servisi - profilo servisi   2011-08-12 15:40:37
Gravatar image thank you very muchj
Tin giao duc - Awesome   2011-08-18 10:09:30
Gravatar image My main concern that does your Jquery code work well on Wordpress ?
thomasfoster96 - Get rid of   2011-08-22 05:13:00
Gravatar image I found this very interesting article on ZURB:

http://www.zurb.com/article/305/easily-turn-your-images-into-polaroids-wi

It only uses the alt attribute of the img, and uses it for a caption. Might be usefull and save a lot of code?
mobilya insaat   2011-08-25 23:05:06
Gravatar image thanks for sharing :!:
zero   2011-08-31 05:13:37
Gravatar image thanks for sharing :) :)
zero   2011-08-31 05:14:41
Gravatar image thanks for sharing :) :)
BooKJr - Laostour   2011-09-09 07:31:39
Gravatar image :!: :?: THank you very much
BooKJr   2011-09-09 07:33:10
Gravatar image ThKK
bake - ThKK   2011-09-22 04:14:24
Gravatar image Nice listing! Thanks for the information!.. Great staff! And great source too... and the comments too... Cheer up!

And also before i forgot, Emma, I will try to visit that site... hope too see additional info!
pradhan rajwant   2011-10-11 21:28:00
Gravatar image thanks
cartoon   2011-10-12 17:09:36
Gravatar image thanks. nice articles.
Anonymous   2011-10-17 01:28:41
Gravatar image B)
Mick - Komputer   2011-10-19 16:36:47
Gravatar image How to achieve this effect using only HTLM5?
Geri - Place   2011-10-23 21:19:13
Gravatar image How can I place the Polaroids only at the middle of the Screen,...?
ps3 black friday sale   2011-10-27 00:18:57
Gravatar image THank you very much :lol: :lol:
ps3 black friday sale   2011-10-27 00:20:23
Gravatar image :idea: :idea:
ps3 black friday sale   2011-10-27 00:22:53
Gravatar image :arrow: :arrow:
lixintong   2011-11-10 08:03:19
Gravatar image :lol: very nice
iBest   2011-11-10 17:39:15
Gravatar image thank you so much. it's a excellent jquery i love it
Anonymous   2011-11-11 01:53:41
Gravatar image [url=http://www.brand-well.com/]
JP   2011-11-17 16:13:33
Gravatar image Upgrade jquery versions to latest and it works in IE9. Still looking into rotating. Nice work Marco, Thanks!
Kat - Default always on top   2012-01-05 21:41:24
Gravatar image Is there a way to make sure that one of the "photos" is always on top whenever the page is loaded? I'd like to add a "photo" that tells users that they can click and drag the photos around, but I'd want to ensure that this "photo" always ends up at the top of the stack. Is it as simple as always making this "photo" the last in the list in the code? Thanks in advance.
mthai - mthai   2012-01-11 09:35:12
Gravatar image Great tutorial thanks
:)
Michaël - on click, recover a php variable?   2012-01-12 09:57:46
Gravatar image Hi ! Excellent Job!

I wonder if there's a way to recover a php variable on mouse click on one of the suggestion?

Like the submit value... or sort of... thanks! :D
Anonymous - re:   2012-01-15 06:43:55
Gravatar image hi Karis
Anonymous   2012-01-21 17:37:15
Gravatar image
CWD - zooming in?   2012-04-02 11:29:28
Gravatar image please, what will be the code for the "zooming in"?
would you please will publish this extension? Thank you so much!
cheers,C
Carlos - add Links in the photos   2012-04-18 18:07:30
Gravatar image can i create links in the photos to redirection one a one to other url?


thanks


Carlos
flash haberler - Flash Haberler   2012-05-09 09:00:28
Gravatar image thank you
zhangdj - nice work   2012-05-15 11:51:02
Gravatar image I think it's a great work,and maybe we could chat more.
zhangdj   2012-05-15 11:52:36
Gravatar image I also find it hard to send the reply as the button should be right but not left....
Farra   2012-05-25 15:28:07
Gravatar image Is there any way to disable random position of polaroids image i want to make same position every time
nils - Scale   2012-06-12 08:28:46
Gravatar image this is a very nice peace of coding!
just one question when i tried the code i saw that the picture's where extremely big.
and when i tried scaling them down, it doesn't work.
Can you guys help me ?

Greets Nils
Cheryl Donahue   2012-07-12 20:22:58
Gravatar image Nice app! I adapted it to work dynamically -- loading images from a dbase into XML; reading the XML with jquery; creating the divs on the fly. Handy. Also, it will work in Firefox now if you add the -moz prefix to the the same code as you use for -webkit. cheers, Cheryl
delock   2012-07-20 07:23:44
Gravatar image Do you have stored the position in your database ?
delock - retrieve position   2012-07-20 07:22:32
Gravatar image HI marco, your code like very good...thank you...

Is there any way to retrieve position and orientation (stored in db or cookie ?)

how can i record position and rotation ?

Regards

Serk
Rebekah - Polaroid Collage IE Issue   2012-11-14 23:13:00
Gravatar image Hi Marco and thank you for this awesome collage effect - I love it and I am excited to integrate it on a site I am working on.

However, the effect works great in all browsers except for IE, the images will not move around.

Do you happen to have a fix for this?


I found this in the comments:

When using IE comment the Code:
'padding-left' : '-4px',
'padding-top' : '-4px',
by placing 2 slashes before it in the script.js file.


But I do not see these lines in the script.js file, and this post was from 2010, so it may have been updated since then.

Please let me know of any information regarding this as I would like to integrate it as soon as possible, if it cannot be fixed for IE then I am going to have to find another solution.

Thanks so much!!
pp - Good idea   2013-01-22 06:44:16
Gravatar image Good idea :lol:
Thanks for sharing :lol: :lol:
Anonymous   2013-01-31 02:02:27
Gravatar image Ajax request failed.
Anonymous   2013-01-31 02:03:03
Gravatar image Do you happen to have a fix for this?
Anonymous   2013-01-31 02:03:16
Gravatar image Do you happen to have a fix for this? :arrow:
Anonymous   2013-02-01 02:26:58
Gravatar image Hi Marco and thank you for this awesome collage effect - I love it and I am excited to integrate it on a site I am working on.
ukash - ukash   2013-02-13 19:10:07
Gravatar image Hello, thank you very much for this information. I want to share this information on my own website
Anonymous   2013-02-20 06:10:04
Gravatar image It's so cool!
S.M. Helal - Rajshahi Education To Information Free   2013-04-11 09:51:41
Gravatar image Rajshahi
Surrey Builders - Surrey Builders   2013-04-30 13:27:23
Gravatar image Thank you for this very helpful article. I have found it quite useful.
Anonymous   2013-05-13 03:48:23
Gravatar image Thanks for the knowledge
Anonymous   2013-05-13 03:50:43
Gravatar image
Read more...
Name:
Email:
  Gravatar enabled.
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Security Image
Please input the anti-spam code that you can read in the image.
Unsubscribe from e-mail notifications.
 
< Prev   Next >
Subscribe

Subscribe to Marcofolio