Re: [jQuery] Height overwrite
Christof Donat schrieb: >> I can not the Textarea give any ID or CLASS, to establish understanding ;) > > Yes you can: Yes, now :) This is my script: $(document).ready(function() { $('textarea').each(function(i) { $(this).id('txtarea_'+i). after('größer<\/span> kleiner<\/span>'); }); $('.gro').click(function() { var txt = $('#txtarea_'+this.id.substr(4)); var NHeight = ($(txt).height()+60)+'px'; $(txt).css({height: NHeight,background: "#c00"}); }); $('.kle').click(function() { var txt = $('#txtarea_'+this.id.substr(4)); var NHeight = ($(txt).height()-60)+'px'; $(txt).css({height: NHeight,background: "#0c0"}); }); }); -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Hi, > I can not the Textarea give any ID or CLASS, to establish understanding ;) Yes you can: $('textarea').each(function(i) { $(this).id('txtarea_'+i). after('höher'); }); $('resize').click(function() { var txt = $('#txtarea_'+this.id.substr(8)); txt.heigth(txt.height()+60).slideDown('slow'); }); Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Olaf Bosch schrieb: > and than works no more Fine, fine, fine This works fine ;) $(document).ready(function() { $("textarea").after("höher"); $('.resize').click(function(){ var NHeight = ($("textarea").height()+60)+'px' $('textarea').css("height",NHeight).slideDown('slow'); }); }); Now i must go to works with more textareas in one document. -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Olaf Bosch schrieb: > Now i must go to works with more textareas in one document. oh, oh, i come not to the end, is works fine, but Now i have multiple textareas and this works for all :( I have experiment with .bind and .prev not works for me. Any ideas? $(document).ready(function() { $("textarea").after("höher
"); var HHH = $(".resize").prev("textarea").height(); alert (HHH); $('.resize').click(function(){ var NHeight = ($("textarea").height()+60)+'px' $(".resize").prev("textarea").css("height",NHeight).slideDown('slow'); }); }); I can not the Textarea give any ID or CLASS, to establish understanding ;) -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Christof Donat schrieb: Thanks, all. work, now i will make better dynamical and unobtrusive. We have: $(document).ready(function() { $("textarea").after("höher"); $('.resize').click(function(){ var NHeight = ($("textarea").height()+60)+'px' $('textarea').css("height",NHeight).slideDown('slow'); }); }); and than works no more > You should also consider to calculate NHeight outside your click-function: Yes i do this first, its must go to rerun. This works when in click! -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Olaf Bosch schreef: > Hello @ all, > this works not for me, what to do? > > > > $(document).ready(function() { > var THeight = $("textarea").height(); > var Diff = 40; > $('.resize').click(function(){ > NHeight = (THeight + Diff); > NHeight = (NHeight+"px") > alert (NHeight); > $('textarea').css("height","NHeight").slideDown('slow'); > }); > }); > > > > > höher > > > > NHeight is set the correct Height, see alert, the CSS works not :( > > Thanks, > I think you got the solution :) -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Olaf Bosch schreef: > Hello @ all, > this works not for me, what to do? > > > > $(document).ready(function() { > var THeight = $("textarea").height(); > var Diff = 40; > $('.resize').click(function(){ > NHeight = (THeight + Diff); > NHeight = (NHeight+"px") > alert (NHeight); > $('textarea').css("height","NHeight").slideDown('slow'); > }); > }); > > > > > höher > > > > NHeight is set the correct Height, see alert, the CSS works not :( > > Thanks, > have you tried $('textarea').css("height",NHeight).slideDown('slow'); -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Hi, > $(document).ready(function() { > var THeight = $("textarea").height(); > var Diff = 40; > $('.resize').click(function(){ > NHeight = (THeight + Diff); > NHeight = (NHeight+"px") > alert (NHeight); > $('textarea').css("height","NHeight").slideDown('slow'); try $('textarea').css("height",NHeight).slideDown('slow'); > }); > }); You should also consider to calculate NHeight outside your click-function: $(document).ready(function() { var NHeight = ($("textarea").height()-40)+'px' $('.resize').click(function(){ $('textarea').css("height","NHeight").slideDown('slow'); )}; )}; Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Height overwrite
Hello, a quick guess: change this line: $('textarea').css("height","NHeight").slideDown('slow'); To $('textarea').css("height", NHeight).slideDown('slow'); (Note the missing quotes) Marc Olaf Bosch schrieb: > Hello @ all, > this works not for me, what to do? > > > > $(document).ready(function() { > var THeight = $("textarea").height(); > var Diff = 40; > $('.resize').click(function(){ > NHeight = (THeight + Diff); > NHeight = (NHeight+"px") > alert (NHeight); > $('textarea').css("height","NHeight").slideDown('slow'); > }); > }); > > > > > höher > > > > NHeight is set the correct Height, see alert, the CSS works not :( > > Thanks, > -- ___ terrestris GbR Marc Jansen Siemensstr. 8 D-53121 Bonn T: ++49 (0)228 - 962 899 54 F: ++49 (0)228 - 962 899 57 Email: [EMAIL PROTECTED] Internet: www.terrestris.de ___ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Height overwrite
Hello @ all, this works not for me, what to do? $(document).ready(function() { var THeight = $("textarea").height(); var Diff = 40; $('.resize').click(function(){ NHeight = (THeight + Diff); NHeight = (NHeight+"px") alert (NHeight); $('textarea').css("height","NHeight").slideDown('slow'); }); }); höher NHeight is set the correct Height, see alert, the CSS works not :( Thanks, -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/