Git Product home page Git Product logo

photoloader's Introduction

PhotoLoader

What does it do?

It displays a larger version of the thumbnail image our user has clicked.

How?

It's relatively simple, it's all to do with folder structure. Inside the main 'Image' folder you will find a sub folder called 'Thumbs' Images/Thumbs/Img.jpg. When our beautiful users click on a thumbnail our script grabs the src of the image and split it by passing our 'Thumbs' subfolder as a separator src.split('Thumbs/'). This leaves us a path to the larger version.

We then grab Mr Big Image's src and say you now equal the split path that we just created.

How does the fade happen

I strongly believe in progressive enhancement so I used css3 transitions to handle the fade for modern browsers and offered a jQuery fallback for older ones.

The css3 works via class names being set on the parentElem once each transition has successfully finished. You will see the interval running that is constantly checking to see if our image has opacity to 0.

Demo

Due to the script relying on our folder structure I couldn't set up a fiddle to demonstate, but I have a working version at alanfewcompany.co.uk/dev/projects-southend.php.

photoloader's People

Contributors

sirbrad avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.