diff options
author | Jos Poortvliet <jospoortvliet@gmail.com> | 2018-07-25 20:54:06 +0300 |
---|---|---|
committer | Jos Poortvliet <jospoortvliet@gmail.com> | 2018-07-25 20:54:06 +0300 |
commit | 23c15a1da24fd711a245cfc3f897cacb6c1f95fb (patch) | |
tree | 2de050323d8f8640cf81913675f008b7a0106f2b | |
parent | 888af8e33663dd473a2afb51a31bda0a975348a1 (diff) |
fix javascript stuff. Need to update this page... I know.
Signed-off-by: Jos Poortvliet <jospoortvliet@gmail.com>
-rw-r--r-- | page-compare.php | 54 |
1 files changed, 3 insertions, 51 deletions
diff --git a/page-compare.php b/page-compare.php index 2276b6a6..bdbab23d 100644 --- a/page-compare.php +++ b/page-compare.php @@ -1,8 +1,8 @@ <head> -<script src="<?php echo get_template_directory_uri(); ?>/assets/js/old/jquery-321.min.js"></script> +<script src="<?php echo get_template_directory_uri(); ?>/assets/js/modules/jquery-321.min.js"></script> <script> require(["require.config"], function() { - require(["pages/compare", "jquery"]) + require(["jquery", "pages/compare"]) }); </script> <link href="<?php echo get_template_directory_uri(); ?>/assets/css/pages/compare.css" rel="stylesheet"> @@ -19,6 +19,7 @@ </div> </div> </div> +</section> <section class="cd-products-comparison-table"> <div class="container-fluid"> @@ -727,53 +728,4 @@ <p>Based on public information to our best knowledge, gathered May 24 2017. We understand the world is constantly changing, if you see we missed a feature or made a mistake, let us know. You can use <a href="<?php echo home_url('contact') ?>">our contact form.</a></p> </div> </section> -<!--<script> -function productsTable( element ) { - this.element = element; - this.table = this.element.children('.cd-products-table'); - this.productsWrapper = this.table.children('.cd-products-wrapper'); - this.tableColumns = this.productsWrapper.children('.cd-products-columns'); - this.products = this.tableColumns.children('.cd-product'); - //additional properties here - // bind table events - this.bindEvents(); -} - -productsTable.prototype.bindEvents = function() { - var self = this; - - self.productsWrapper.on('scroll', function(){ - //detect scroll left inside products table - }); - self.products.on('click', '.top-info', function(){ - //add/remove .selected class to products - }); - - self.filterBtn.on('click', function(event){ - //filter products - }); - //reset product selection - self.resetBtn.on('click', function(event){ - //reset products visibility - }); - - this.navigation.on('click', 'a', function(event){ - //scroll inside products table - left/right arrows - }); -} - -var comparisonTables = []; -$('.cd-products-comparison-table').each(function(){ - //create a productsTable object for each .cd-products-comparison-table - comparisonTables.push(new productsTable($(this))); -}); - -productsTable.prototype.updateLeftScrolling = function() { - var scrollLeft = this.productsWrapper.scrollLeft(); - - if( this.table.hasClass('top-fixed') && checkMQ() == 'desktop') setTranformX(this.productsTopInfo, '-'+scrollLeft); -} -</script>--> -<script> -</script> |