Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- events: function(){
- var
- plus = 'input[name="zform_height_plus"]',
- minus = 'input[name="zform_height_moins"]';
- $("._height_button").bind('click', function() {
- var
- val = $(this).prev("input").val(),
- parent = $(this).parent("div"),
- next = parent.next(".zform:first"),
- textarea = $("textarea", $(next));
- if (val >= sdz.initHeight) {
- textarea.css('height', val);
- }
- });
- $("._height").bind("keypress", function (e) {
- if (e.type === 'keypress') {
- if (e.keyCode === 13){
- $(this).next("._height_button:first").trigger("click");
- return false;
- }
- }
- });
- $(plus ", " minus).bind('click', function(){
- var
- parent = $(this).parent("div"),
- next = parent.next(".zform:first"),
- textarea = $("textarea", $(next)),
- nudge = 50,
- newHeight = 0;
- if ($(this).attr("name") === "zform_height_moins") {
- nudge = -50;
- }
- newHeight = textarea.height() nudge;
- if (newHeight >= sdz.initialHeight) {
- textarea.css('height', newHeight);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement