Difference between revisions of "Template:NKU China/js/share"

Line 1: Line 1:
 
var debug = true;
 
var debug = true;
 
var igem = document.location.href.includes('https://2016.igem.org/');
 
var igem = document.location.href.includes('https://2016.igem.org/');
//element is inner jquery, $('.auto-adjust') is middle jquery. Inner jquery is 100% embed in its parent--middle jquery. So we just need to automatically adjust middle jquery accordingly to outer jquery
 
function auto_adjust() {
 
    $('.auto-adjust-inner').each(function (index, value) {
 
        var inner = $(value)
 
        var middle = inner.parent();
 
        var outer = middle.parent();
 
        var ratio = inner.width() / inner.height();
 
  
        function impl() {
+
function particles() {
            middle.width(outer.width());
+
    $('#particles-js').toggle()
            middle.height(outer.width() / ratio);
+
        }
+
 
+
        impl();
+
        window.addEventListener('resize', impl)
+
    })
+
 
}
 
}

Revision as of 00:34, 21 September 2016

var debug = true; var igem = document.location.href.includes('https://2016.igem.org/');

function particles() {

   $('#particles-js').toggle()

}