I wrote this for work the other day and it won't wind up being used, so here it is. These two event listeners can be used on two HTML <range> inputs for a 'minimum and maximum' selection. The max cannot be set smaller than the min and the min cannot be more than the max.
The HTML:
Minimum Font Size:
<input id="font_min" type="range" min="10" max="80" step="1" value="12" />
<span id="font_min_val"></span>
Maximum Font Size:
<input id="font_max" type="range" min="10" max="80" step="1" value="30" />
<span id="font_max_val"></span>
The jQuery:
$("#font_min").change(function () {
$("#font_min_val").text($(this).val()+"px");
if ($(this).val() >= $("#font_max").val()) {
$("#font_max").val($(this).val());
$("#font_max_val").text($("font_max").val()+"px");
}
});
$("#font_max").change(function () {
$("#font_max_val").text($(this).val()+"px");
if ($(this).val() <= $("#font_min").val()) {
$("#font_min").val($(this).val());
$("#font_min_val").text($("font_min").val()+"px");
}
});
Snippets of code and tricks that would otherwise be forgotten. Useful for me, hopefully for you too.
Tuesday, April 16, 2013
Thursday, April 4, 2013
Blender Hotkeys I will never remember
r - rotate current object. use x,y,z to contrain axis of rotation.
s - scale. use x,y,z
g - move - use x,y,z
z - toggle wireframe view
NumberPad keys control view angle.
NUM5 - toggle 3d / orthographic view
b - marquee / loop selection
SHIFT+R - initiate loop cut. Use mouse wheel to select the number of loops to cut
CTRL+D - duplicate an object. use x,y,z to constrain to one dimension for relocating the clone
s - scale. use x,y,z
g - move - use x,y,z
z - toggle wireframe view
NumberPad keys control view angle.
NUM5 - toggle 3d / orthographic view
b - marquee / loop selection
SHIFT+R - initiate loop cut. Use mouse wheel to select the number of loops to cut
CTRL+D - duplicate an object. use x,y,z to constrain to one dimension for relocating the clone
Subscribe to:
Posts (Atom)