Difference between revisions of "User:Andr3w/vector.js"

From SQLZOO
Jump to: navigation, search
Line 10: Line 10:
 
         for(var i=0;i<clist.length;i++)
 
         for(var i=0;i<clist.length;i++)
 
           if (clist[i].length>2 && clist[i].substr(0,2)=='e-')
 
           if (clist[i].length>2 && clist[i].substr(0,2)=='e-')
             varlst.push({engine:clist[i].substr(3),val:$(this)})
+
             varlst.push({engine:clist[i].substr(2),val:$(this)})
 
       });
 
       });
 
     }
 
     }

Revision as of 11:12, 6 March 2014

//Deal with variations in the "how to" scripts
//Copy this to common.js when tested
$(
  $('div.ht').each(function(){
    var lnglst = $('.def',this);
    var varlst = [];
    if (lnglst.length>1){
      $('.def',this).each(function(){
        var clist = $(this).attr('class').split(' ');
        for(var i=0;i<clist.length;i++)
          if (clist[i].length>2 && clist[i].substr(0,2)=='e-')
            varlst.push({engine:clist[i].substr(2),val:$(this)})
      });
    }
    console.log(varlst);
  })
)
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense