Well, I tried, I really tried.

I have the following code:

function test(isExpanding)
{
var x=start+"%,*";

if(isExpanding==1)
    start++;
else
    start--;
top.$("#main_frame").attr("cols",x);
alert(x);
if(isExpanding==1 && start<21)
    setTimeout(test(isExpanding),500);
else if(isExpanding==0 && start>1)
    setTimeout(test(isExpanding),500);
}

That code is called like this first time:

setTimeout(test(0),500);

This code immediately reaches var start=2, no transition, no
iterations ( I alerted it, and alert popped up once).
I just can't understand the logic that goes behind this. Each call
should increase or decrease var start with one then call itself
instead it goes...randomly, abnormally. The lack of debugging also
bothers me, it had become rough guessing of where the error could be.
God, I miss my C#....
So, can you suggest anything else?

On dec. 4, 22:47, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> I'm going to toss this out there, though you may not want the effort.
>
> You could sort of "roll your own" animation that uses the attribute, rather
> than the CSS.
>
> It would involve a setTimeout, and use the $(el).attr('cols',val);
>
> Again, that's a lot of plumbing to tackle, but any attribute that can be set
> by jQuery.attr can be animated.
>
> JK
>
>
>
> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of andriscs
> Sent: Thursday, December 04, 2008 1:35 PM
> To: jQuery (English)
> Subject: [jQuery] Re: How to animate frameset properties?
>
> I tried it, believe me. :)
>
> Yet I had to use frames due to close deadlines as divs that I used
> were placed abnormally everwhere depending on which browser were
> presented in.
> I have to create a navigation side on the left and a content area on
> the right. The menu should always be visible while the content should
> be scrollable. The menu should become hidden on click and the
> splitting between the sides should be adjustable. Tell me, is there
> div-based jQuery code that accomplishes this? I use jTree for the
> navigation menu and I tried jSplitter for creating the splitter but I
> couldn't create an always visible yet scrollable layout :)
>
> So I reverted back to frames and it works well in major browsers, I
> can adjust splitter, I can scroll content, I just lost the possibility
> of creating a smooth animation ( I animate the disappearing of the
> navigation menu).
>
> If you have better ideas, tell me.
>
> On dec. 4, 02:28, ricardobeat <[EMAIL PROTECTED]> wrote:
> > You can only animate CSS properties, the col width is not one of them.
> > Get rid of the frames and use some clean code :)
>
> > On Dec 3, 9:40 pm, andriscs <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I know it's kinda lame, but I should animate the setting of a
> > > frameset'scolsproperty.
> > > So far I managed to learn that html properties can be animated using
> > > anime({prop:”value”},duration)
> > > I created for example a font size changer using that code.
> > > As I work now with frames, I tried to modify a frameset’s properties:
> > > first I used the following code:
> > > top.$("#main_frame").attr("cols","0%,*");
> > > It worked fine, the leftframedisappeared. I just wanted to make it
> > > with animation, so I tried the following:
> > > top.$("#main_frame").animate({cols:"0%,*"},600);
> > > but nothing happened. Is it because attribute ’cols’ cannot be
> > > animated by jQuery’s inner mechanism? Honestly, I don’t feel much
> > > difference between animating width property andcolsproperty. Do you
> > > have any idea of how to animate that kind of operation?
> > > If not possbile what else solution would you suggest me to hide a left
> > > sided navigation menu that resides in aframe?

Reply via email to