Support

Account

Forum Replies Created

  • Dang it actually that didn’t work exactly as expected. It initially assigns the width as the new width but it doesn’t stick and goes back to whatever the default width is. When i change #theme-column on load, it goes right back to the default width

  • Sorry about that the .exists() function is a jquery plugin that I regularly use for checking if an element is on page or not. Super Useful.

            // Tiny jQuery Plugin
    	// by Chris Goodchild
    	$.fn.exists = function(callback) {
    	  var args = [].slice.call(arguments, 1);
    
    	  if (this.length) {
    		callback.call(this, args);
    	  }
    
    	  return this;
    	};

    As for using the .each() function, extremely smart thing to do. I don’t know why that slipped my mind to check for each instance of the element. Worked like a charm!

  • I’m not entirely sure why my previous code wasn’t working but it looks like that truncated version actually does the job I need.

    Old Code that was returning an empty value

    $(document).ready(function () {
    	if($('#range-id input[type=number]')){
    		$(this).change(function(){
    			$(this).val(10);
    			console.log($(this));
    			alert($(this).val());
    			;
    		});
    	}
    });

    New Code that works

    $(document).on('change', '#range-id input', function() {
    	alert($(this).val());
      });
    }
Viewing 4 posts - 1 through 4 (of 4 total)