Cargo home Twitter Devlog

Adding Cargo functions to links

Last Updated: Jul 03, 2013 02:45PM PDT
Cargo has a number of keyboard-based shortcuts that can be used in most designs. If you want to add them into your website as clickable links or integrate them into your own scripted modifications, start with the code below:
 
Display random project (except in Feed-based designs)
 <a href="javascript:void(0)" onclick="$(document).trigger('showRandomProject');">Random project</a>
 
Display next project/post in list (except in xFeed)
<a href="javascript:void(0)" onclick="$(document).trigger('showNextProject');">Next Project →</a>
 
Display previous project/post in list (except in xFeed)
 <a href="javascript:void(0)" onclick="$(document).trigger('showPrevProject');">Previous Project ←</a>
 
Scroll to top of browser window (except in xFeed)
 <a href="javascript:void(0)" onclick="Projects.Helper.ScrollToTop();">Scroll to top ↑</a>
 
Close currently-open project (except in Feed-based designs)
 <a href="javascript:void(0)" onclick="Projects.CloseProject();">Close Project ×</a>

Landsat has a couple of design specific-functions, since it displays as a slideshow composed of many other slideshows. 

The following are Landsat-only:
<a href="javascript:void(0)" onclick="showPrevIMG()">Show previous image/video</a>
<a href="javascript:void(0)" onclick="showPrevIMG('nav')">Show previous image, and go to the previous project when there are no more images available</a>
<a href="javascript:void(0)" onclick="showNextIMG()">Show previous image/video</a>
<a href="javascript:void(0)" onclick="showNextIMG('nav')">Show previous image, and go to the next project when there are no more images available</a>
tickets@cargocollective.com
http://assets3.desk.com/
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
Invalid characters found
/customer/en/portal/articles/autocomplete