do-web / jTinder

jTinder is a javascript library that makes rating people, products, images very easy and fast. It is optimized for mobile touch device but has also a desktop fallback.
GNU General Public License v2.0
235 stars 99 forks source link

how to dynamically update the images #26

Closed noamhacker closed 6 years ago

noamhacker commented 7 years ago

I needed to dynamically update the images in the card stack, because I'm randomizing the order on every page reload. The readme only says you can update the images by changing the css, but I came up with a quick jquery command to dynamically change images. Thought I would share here for anyone else who might need:

$('.pane5 .img').css('background', 'url('+'URL_HERE'+')'+' no-repeat scroll center center').css('background-size', 'cover')

Just replace pane5 with your pane number and URL_HERE with the image url.