javascript - Isotope.js help: Changing item image after sorting -


i able achieve originaly set out in post bellow, ran problem multi-class items display multiple images. my main question whether took right approach solving original goals or if there more clever way active same effect, in turn fixing 1 problem have. here break down:

1) achieve image change feature, used css hide multiple inline seasonal images in each sortable item. used bit of js apply class of .seen items sorted. relied on css again display images inteneded.

2) 1 problem found if sortable item has more 1 seasonal class, 2 images shown when either of classes become active. know can hide problem setting set width , height .grid .sortable-item , controlling overflow (commented out in example show problem) - but, don't want hide it. how can display seasonal image intended when class becomes active?

here code pen code: http://codepen.io/anon/pen/nrlwk

as always, appreciated.


this general question on how go building project have in mind, , best way set off on right foot. new js, please gentle.

i want use isotope.js (or similar script) display page multiple items (about 30 different plants found in garden) , ability sort them seasons of year + "what beautiful now" + , "view all" (a total of 6 categories) .

on load, or when sorted either "what beautiful now" or "view all", need each item reflect image of current season in.

when sorted season, need "current" images switch on designated seasonal image of plant. therefore, each sortable item have 4 different versions 4 different images in background ready surface when plants sorted. (perhaps 5 if makes more sense have "current" version besides 4 seasonal versions.)

my question: what approach can take achieve effect in manageable way?

can isotope apply class items sorted? assuming can:

  1. should each item have 4 inline images, each css class, control using display:inline; , display:none; properties stylesheets? (i worry approach increase load times)
  2. would make more sense create blank dummy div who's background control example above -relying on css.
  3. or there other way involving js overlooking?

any appreciated. examples of suggest immensely helpful.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -