Hello... here is another thry to work around this issue... any ideas on this...
$(this).contents("[childNodes=0]").not(".readME").addClass("sizeME"); var $size = $(".sizeME"); var $read = $(".readME"); function doSomething() { var NEWheight = $read.offsetHeight; var NEWwidth = $read.offsetWidth; $size.height(NEWheight+'px'); $size.width(NEWwidth+'px'); }; Any help here would be great... I'm just spining my wheels at this point but I don't want to go back wards to what worked as the whole start of this issue would be back.... thanks for anyhelp here... Jeremy On Sep 24, 12:51 am, jeremyBass <[EMAIL PROTECTED]> wrote: > Rock on.. that made more sense... I was not understanding why I needed > that line... but I get it now.... as far as the rest... > > it's just a trageting issue I think.... this is the latest try.... > (the last part) > > this.innerHTML = '<div class="clear_children readME">'+this.innerHTML > +'</div><div class="clear_children"></div>'; > htmlOptions.height = this.firstChild.offsetHeight; > $this.addClass('').prepend($.fn.flash.transform(htmlOptions)); > > $(this).contents("[childNodes=0]").not(".readME").addClass("sizeME");// > fix bleeding to the last div > > var $size = $(".sizeME"); > var $read = $(".readME"); > function doSomething() { > var NEWheight = $ > (this).contents("[childNodes=1]").not(".sizeME").offsetHeight; > var NEWwidth = $ > (this).contents("[childNodes=1]").not(".sizeME").offsetWidth; > $(this).contents("[childNodes=0]").not(".readME").height(NEWheight > +'px'); > $(this).contents("[childNodes=0]").not(".readME").width(NEWwidth > +'px'); > > }; > > var resizeTimer = null; > $(window).bind('resize', function() { > if (resizeTimer) clearTimeout(resizeTimer); > resizeTimer = setTimeout(doSomething, 3); > }); > > }); > > this it the order... > > <div class="Round_gen1"> > <embed class="sizeMe"> > <div class="readMe"></div> > </div> > > so I'm tring to get the embed to match the size of the offset of the > nextSibling > > just have not found a good way to do this ... the script doesn't throw > any errors... but anit working .. any help would be great ... thank > you more and more this is coming in to focus > > jeremyBass > > On Sep 23, 11:53 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > Right at the start: > > > $('[class^=Round_gen]').filter(function(){ > > return /Round_gen[0-9]+/.test( $(this).attr('class') );}).each(function(){ > > > // at this point $(this) is a single element > > var $this = $(this); > > var params = $(this).attr('rel').split(':'); > > etc, etc. > > > /*** you don't need this, it's only if you need the number in the > > className var n = $(this).attr('class').match(/[0-9]+/); ***/ > > > didn't have time to look through the rest of the code though. > > > On Sep 23, 11:10 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > Hello, ok... so thou yes it works... and I am thankful for you guys > > > for helping, it through a monkey wrench into the fallowing code... may- > > > be some one could give me a hand on "this" ... (thats was the area of > > > issues before :-) > > > > here is the code with the changes as suggested above... > > > > $('[class^=Round_gen]').filter(function(){ > > > return /Round_gen[0-9]+/.test( $(this).attr('class') );}).each(function(){ > > > > var n = $(this).attr('class').match(/[0-9]+/); > > > $(this).each(function() {var $this = $(this); > > > var params = $(this).attr('rel').split(':'); > > > $(this).flash({flashvars: { > > > right_off : ['' + params[4] + ''], > > > left_off : ['' + params[5] + ''] > > > .join(' ') > > > }}, { version: 8 }, function(htmlOptions) { > > > > htmlOptions.src = params[0]; > > > htmlOptions.width = params[1]; > > > htmlOptions.wmode = params[3]; > > > htmlOptions.style = ""; > > > this.innerHTML = '<div > > > class="clear_children">'+this.innerHTML+'</ > > > div>'; > > > htmlOptions.height = this.firstChild.offsetHeight; > > > > > > $this.addClass('').prepend($.fn.flash.transform(htmlOptions)); > > > //////////////////////////////////////////////////////////// > > > //////there is probly a better way to target come back to (try not to > > > use .clear_childern) swicth to $this???? > > > //////////////////////////////////////////////////////////// > > > $ > > > (this).contents("[nodeType=1]").not(".clear_children").addClass("sizeME"); > > > var self = this; > > > > function doSomething() { > > > var NEWheight = self.childNodes[1].offsetHeight; > > > $ > > > (this).contents("[nodeType=1]").not(".clear_children").height(NEWheight > > > +'px'); > > > }; > > > //////////////////////////////////////////////////////////// > > > //////////////////////////////////////////////////////////// > > > var resizeTimer = null; > > > $(window).bind('resize', function() { > > > if (resizeTimer) clearTimeout(resizeTimer); > > > resizeTimer = setTimeout(doSomething, 3); > > > }); > > > }); > > > }); > > > > }); > > > > this was the way it was.... Which worked... > > > > $('.Round2').each(function() {var $this = $(this); > > > var params = $(this).attr('rel').split(':'); > > > $(this).flash({flashvars: { > > > right_off : ['' + params[4] + ''], > > > left_off : ['' + params[5] + ''] > > > .join(' ') > > > }}, { version: 8 }, function(htmlOptions) { > > > > var $this = $(this); > > > var params = $(this).attr('rel').split(':'); > > > htmlOptions.src = params[0]; > > > htmlOptions.width = params[1]; > > > htmlOptions.wmode = params[3]; > > > htmlOptions.style = ""; > > > this.innerHTML = '<div > > > class="clear_children">'+this.innerHTML+'</ > > > div>'; > > > htmlOptions.height = this.firstChild.offsetHeight; > > > > $this.addClass('').prepend($.fn.flash.transform(htmlOptions)); > > > //////////////////////////////////////////////////////////// > > > //////there is probly a better way to target come back to (try not to > > > use .clear_childern) swicth to $this???? > > > //////////////////////////////////////////////////////////// > > > $ > > > ('.Round2').contents("[nodeType=1]").not(".clear_children").addClass("targetME2"); > > > var self2 = this; > > > function doSomething2() { > > > var NEWheight2 = self2.childNodes[1].offsetHeight; > > > $ > > > ('.Round2').contents("[nodeType=1]").not(".clear_children").height(NEWheight2+'px');}; > > > > //////////////////////////////////////////////////////////// > > > //////////////////////////////////////////////////////////// > > > var resizeTimer2 = null; > > > $(window).bind('resize', function() { > > > if (resizeTimer2) clearTimeout(resizeTimer2); > > > resizeTimer2 = setTimeout(doSomething2, 3); > > > }); > > > > }); > > > }); > > > > The short of it is that I was needing to have the first child element > > > be the same height and it's next sibling... I worked hard to get it > > > going and I did... the problem the whole time was that I was not able > > > to target the first child and change the height based on the offset > > > height of the first child's next sibling... but the way I have it > > > above did work... and was promising... but with the suggest changes I > > > can't see a way to fix it as "this" was the issue the first time > > > around... any ideas on this? > > > > thank you for the help > > > jeremyBass > > > > On Sep 23, 5:16 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > There is no need for quotes as everything is already a string. > > > > > Jeremy, you need to understand what's going on: > > > > > $('[class^=Round_gen]').filter(function(){ > > > > // checks for any element where the 'class' attribute starts with > > > > 'Round_gen' > > > > > return /Round_gen[0-9]+/.test( $(this).attr('class') ); > > > > // 'test' is a method of the regular expression, that will test this > > > > element's attribute 'class' against it, returning true or false. there > > > > is no attribute called 'Round_gen' > > > > > }).each(function(){ > > > > > var n = $(this).attr('class').match(/[0-9]+/); > > > > // again, we are testing the CLASS attribute against the > > > > regex, this will return the matched part (i.e the numbers in the > > > > classname) > > > > > //in here you also want your code for each element, $(n) is not gonna > > > > do anything as n is just a number, use $(this) > > > > > }); > > > > > hope it's clearer now! > > > > > - ricardo > > > > On Sep 23, 6:13 pm, tlphipps <[EMAIL PROTECTED]> wrote: > > > > > > Just need some quotes around the class name (I forgot to include some > > > > > quotes in my example too) > > > > > > This should work: > > > > > $("[class^='Round_gen']") > > > > > > On Sep 23, 4:04 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > So tring to get this going I did > > > > > > > var n = ''; > > > > > > $('[class^=Round_gen]').filter(function(){ > > > > > > return /Round_gen[1-9][0-9]+/.test( $(this).attr('Round_gen') > > > > > > );}).each(function(){ > > > > > > > var n = $(this).attr('Round_gen').match(/[0-9]+/); > > > > > > > }); > > > > > > > $('.Round_gen'+n+'').each(function() {...ect > > > > > > > and Got it picking up .Round_gen only ... not Round_gen9 or > > > > > > Round_gen99 > > > > > > > I think I'm close > > > > > > thanks for the help... > > > > > > jeremyBass > > > > > > > On Sep 23, 11:49 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > > So let say the class was named Round_gen9 > > > > > > > > I'd replace > > > > > > > > $('.Round_gen9'').each(function() {....etc > > > > > > > > with > > > > > > > > $('[class^=Round_gen]').filter(function(){ > > > > > > > return /Round_gen[0-9]+/.Round_gen( $(this).attr('Round_gen') > > > > > > > );}).each(function(){ > > > > > > > > var n = > > ... > > read more »- Hide quoted text - > > - Show quoted text -