Advertisement
SSTWebmaster

popPlugin

Sep 21st, 2011
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.41 KB | None | 0 0
  1. (function($){
  2.     $.fn.jqDepCalc = function(options){
  3.        
  4.         var defaults = {
  5.                 x:"",
  6.                 ftd: 0,
  7.                 tgt:""
  8.             }
  9.         return this.each(function(){
  10.             var $this = $(this);
  11.            
  12.             if(options){
  13.                 var o = $.extend(defaults,options);
  14.             }
  15.            
  16.            
  17.             if(o.x == 1 || o.x == 9){
  18.                 o.ftd = 0;
  19.             }else{
  20.                 o.ftd = o.ftd+1
  21.             }
  22.            
  23.             //alert(o.ftd);
  24.            
  25.             $(o.tgt).val(o.ftd);
  26.         })
  27.        
  28.     };
  29. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement