Created
February 3, 2014 19:41
-
-
Save GoingOffRoading/8790874 to your computer and use it in GitHub Desktop.
JustinCSSJQueryChanges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
jQuery(function($){ | |
$(window).on('recommendations.loaded', function(){ | |
setTimeout(function(){ | |
var recsSlider = jQuery("#rr_1 .jcarousel"), | |
count = 5, | |
maxPages = 0, | |
pages = jQuery('#rr_1 .recs-pages'), | |
pageCount = Math.min(Math.ceil(jQuery('#rr_1 .rr_product').length/count)), | |
newDots = jQuery('#rr_1 .recs-pages span').slice(0, pageCount); | |
recsSlider.off('create.jcarousel'); | |
recsSlider.on('create.jcarousel', function(e, carousel){ | |
var total = recsSlider.jcarousel('items').length, | |
i = 0; | |
maxPages = Math.ceil(total / count); | |
pages.html(''); | |
for(i = 0; i < maxPages; i++) { | |
var span = jQuery('<span />').click(function() { | |
recsSlider.jcarousel('scroll', jQuery(this).index()*count, true); | |
}); | |
pages.append(span); | |
} | |
pages.find('span').eq(0) .addClass('active'); | |
}); | |
recsSlider.off('scrollend.jcarousel'); | |
recsSlider.on('scrollend.jcarousel', function(e,carousel){ | |
var t = recsSlider.jcarousel('target'), | |
pos = t.index(), | |
page = Math.min(Math.ceil(pos/count), maxPages-1); | |
pages.find('span').removeClass('active').eq(page).addClass('active'); | |
}); | |
jQuery('#rr_1 .featured-previous').off('click'); | |
jQuery('#rr_1 .featured-previous').on('click', function(e){ | |
e.preventDefault(); | |
recsSlider.jcarousel('scroll', "-="+count, true); | |
}); | |
jQuery('#rr_1 .featured-next').off('click'); | |
jQuery('#rr_1 .featured-next').on('click', function(e){ | |
e.preventDefault(); | |
recsSlider.jcarousel('scroll', "+="+count, true); | |
}); | |
recsSlider.trigger('create.jcarousel'); | |
$('.container_12:eq(0)').prepend($('#rr_1')); | |
$( "#rr_1" ).slideDown( "slow", function() { | |
// Animation complete. | |
}); | |
},1000); | |
}); | |
}); | |
</script> | |
<style> | |
#rr_1 { | |
display: none; | |
} | |
.rr-recs-beta { | |
margin: 0px 0px 10px 0 !important; | |
} | |
.rr-recs-beta .recs-pages { | |
margin-top: 0px !important; | |
} | |
.rrName { | |
font-size: 11px !important; | |
line-height: 1.5 !important; | |
display: none !important; | |
} | |
.container_12 .modulebox { | |
border: none !important; | |
} | |
.reviewCount { | |
font-size: 10px !important; | |
margin-top: 3px !important; | |
color: #777 !important; | |
} | |
.rr_boxbody .rr_product { | |
height: auto !important; | |
width: 131px !important; | |
padding-right: 10px !important; | |
} | |
.rr_product_image_link img { | |
width: 125px !important; | |
} | |
.rr-recs-beta .featured_list { | |
height: auto !important; | |
} | |
.rr_boxbody { | |
padding: 0px 10px 0px 10px !important; | |
margin-top: -24px !important; | |
border-bottom: none !important; | |
} | |
.rr_boxhead h2.heading { | |
background-image: none !important; | |
background-color: #FFF !important; | |
padding: 8px 8px 8px 8px !important; | |
font-size: 16px !important; | |
font-family: Bitter; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment