Last active
March 8, 2017 18:49
-
-
Save seedcms/eb9ad0ea2e49c501441c0de600a76e79 to your computer and use it in GitHub Desktop.
pressify-modal-v1-external-link
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
<div class="press_modal_wrapper"> | |
<div class="press_modal"> | |
<div class="press_toolbar"> | |
<div class="press_title"></div> | |
<div class="press_close"><a href="#" class="close_press" press-id="{{forloop.index}}">CLOSE X </a></div> | |
<div style="clear: both;"></div> | |
</div> | |
<div class="slide_container"> | |
<ul class="pressslider"></ul> | |
</div> | |
<div class="product_container"> | |
<strong class="product_shop">Shop The Product</strong> | |
<ul class="pressify_product_grid"> | |
<li> | |
<a href="#" class="product_href"> | |
<div class="product_img"></div> | |
<!-- <div class="product_title"></div> --> | |
</a> | |
</li> | |
</ul> | |
</div> | |
<div style="clear: both;"></div> | |
{% comment %}<div class="press_modal_links" style="position: relative; float: right; text-decoration: underline;"><a href="#" class="press_url">Read Article</a></div>{% endcomment %} | |
<div class="press_modal_links" style="position: relative; float: left;"><a href="#" class="press_comment"></a></div> | |
</div> | |
</div> | |
<script src="https://pressify.s3.amazonaws.com/assets/bxslider/jquery.bxslider.min.js"></script> | |
<script src="https://pressify.s3.amazonaws.com/assets/masonry.pkgd.min.js"></script> | |
<script type="text/javascript"> | |
$(window).load(function(){ | |
$('.pressify_wrapper').masonry({ | |
// options | |
itemSelector: '.box' | |
}); | |
$('.pressify-loader').hide(); | |
$('.pressify-content').show(); | |
}); | |
// load products | |
var slider = jQuery('.pressslider').bxSlider({ | |
minSlides: 1, | |
maxSlides: 1, | |
slideWidth: 500, | |
slideMargin: 10 | |
}); | |
jQuery(".go_carousel").click(function(){ | |
var showbox = jQuery(this).attr('href'); | |
var handle = jQuery(this).attr('product-handle'); | |
var press_id = jQuery(this).attr('press-id'); | |
var title = jQuery(this).attr('press-title'); | |
var comment = jQuery(this).attr('press-comment'); | |
var press_url = jQuery(this).attr('press-url'); | |
var press_target = jQuery(this).attr('press-target'); | |
var article_id = jQuery(this).attr('article-id'); | |
jQuery('.product_container').hide(); | |
jQuery.getJSON('https://seedpressify.herokuapp.com/products/show.json?article_id='+article_id, function(products) { | |
jQuery('.product_shop').show(); | |
jQuery('.json_product').remove(); | |
jQuery.each( products, function( key, val ) { | |
jQuery.getJSON('/products/'+val.product_handle+'.js', function(product) { | |
jQuery('.pressify_product_grid').append( '<li class="json_product"><a href="/products/'+val.product_handle+'"><div class=""><img src="'+product.images[0]+'" style="max-width: 100%; max-height: 200px;" /></div><!-- <div class="product_title">'+product.title+'</div> --></a></li>' ); | |
}); | |
jQuery('.product_container').show(); | |
}); | |
productslider.reloadSlider(); | |
}); | |
jQuery('.press_title').html(title); | |
jQuery('.press_comment').html(comment); | |
jQuery('.press_comment').attr('href',press_url); | |
jQuery('.press_comment').attr('target',press_target); | |
jQuery('.press_modal_wrapper').show(); | |
jQuery('.pressslider').html(jQuery('#slides'+press_id).html()); | |
slider.reloadSlider(); | |
if(handle){ | |
jQuery.getJSON('/products/'+handle+'.js', function(product) { | |
jQuery('.product_shop').show(); | |
jQuery('.product_href').attr('href','/products/'+handle).show(); | |
jQuery('.product_title').html(product.title).show(); | |
jQuery('.product_img').html('<img src="'+product.images[0]+'" style="max-width: 100%; max-height: 200px;" />').show(); | |
}); | |
}else{ | |
jQuery('.product_href').hide(); | |
jQuery('.product_title').hide(); | |
jQuery('.product_img').hide(); | |
jQuery('.product_shop').hide(); | |
} | |
}); | |
jQuery(".close_press").click(function(){ | |
var press_id = jQuery(this).attr('press-id'); | |
jQuery('.press_modal_wrapper').hide(); | |
return false; | |
}); | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment