Skip to content

Instantly share code, notes, and snippets.

@raulsouzalima
Created April 21, 2012 16:02
Show Gist options
  • Save raulsouzalima/2438013 to your computer and use it in GitHub Desktop.
Save raulsouzalima/2438013 to your computer and use it in GitHub Desktop.
$("#products .product_container").each(function(index) {
if($(this).find("ul").html() == "") {
switch(index) {
case "1" :
<% position = 1 %>
break;
case "2" :
<% position = 2 %>
break;
default :
<% position = 0 %>
}
InitSuggestion.slideTo("#products");
$(this).find("ul").html("<%= escape_javascript(render :partial => 'shared/suggestive_product', :locals => {:product => @product, :position => position}) %>").fadeIn();
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment