> Did you manage to get it to work?

Yep, I did -- just had to do a little more juggling of variables than I'd
originally expected.

> You inspired me to see if I could
> make frames open and collapse.

I'm flattered. I inspire people. :P

> This works in Mozilla 1.1 and IE 6:

> function size(size)
> {
>       parent.document.getElementById("framez").cols = size + ',
>       *';
> }

I thought document.getElementById() was an ieism... I really need to brush
up on the DOM.

> where "framez" is the name of the frameset in question.

> If you pass 0 as the size, the frame dissapears
> completely.

I was actually able to accomplish it, iirc by referencing size on the frame
itself... let me see...

<cfset variables.framesize = iif(ListFindNoCase
  (request.user.openMenus,'helpnav'),
  request.settings.helpNavWidth, 0)>

<cfoutput>
  <frameset name="helpframeset"
    cols="#variables.framesize#,*"
    frameborder="0" border="0">

    <frame id="helpnav" name="helpnav"
      src="navleft.cfm?userid=#request.userid#" />

    <frame id="help" name="help"
      src="#attributes.page#" />

  </frameset>
</cfoutput>


function toggleHelpConsoleMenu() {
  var menuItem = top.frames.helpframeset;

  var menuHandle = document.getElementById("helpnav_handle");

  var url = "http://"; + tap.url + "/netap/menu.cfm?UserID="
    + UserID + "&menuname=helpnav&FuseAction=";

  if (parseInt(menuItem.cols)==0) {

    url += "openMenu";
    menuItem.cols =
      new String("" + window._helpNavWidth + ",*");

    menuHandle.src = "http://"; + tap.url
      + "/netap/_img/minus.gif";

  } else {

    url += "closeMenu";
    window._helpNavWidth =
      top.frames.helpnav.document.body.clientWidth;

    menuItem.cols = "0,*"; menuHandle.src = "http://";
      + tap.url + "/netap/_img/plus.gif";

  }

  top.iUtil.location.replace(url); return;
}

Nope, I did it the same way you did. I made a couple changes to the code
here for the sake of line wrap when my mail client sends, removing stuff
that's not really relevant, etc...

This function contains more than the expand / colapse functionality.

All the url's in the javascript are for the purpose of passing data back to
the CF server so that it can save the current size and open/closed status of
the left frame. This way if the user refreshes the top window ( the help
system is in a popup ), the resizeable left frame won't snap back to its
default size ( which I figured could get annoying ). Links within the help
system target _top so that they also won't also go back to the page they
started on if they refresh the window.

> Just for fun, I wrote this in a self-referencing CF page,
> but I can't think of a single good use for that. :-)

The context-sensitive help for Tapestry is displayed in a popup, and I
wanted it to take up as little screen realestate as possible by default ( I
think it was 350px wide originally ). I added the frames after the fact for
the purpose of adding the left menu to make it easier to navigate the help (
before each page had a menu at the bottom ), and to allow add-on components
to add their own links to the menu instead of relying solely on the
context-sensitivity to display help for add-on components. ( All the help
files were generated by the cms as .htm instead of .cfm files, so the menu
on the left was added in as a .cfm dynamic component to allow for this )

Letting the user open and close the left frame ( via a link in the top frame
which I removed from the code above for legibility ) allows users more
control over how the screen realestate for the help is used ( much like
turning on or off the feature panels in CF Studio ). If a user has low
resolution on their monitor ( I use 1280x1024 near maximized browsers all
the time, so I try to be extra sensitive of the fact that most users won't
have this kind of realestate ), and they pop open the new help ( which is
now 500px wide by default ) this may take up most of their view. By closing
the left side menu and resizing the window they can get back 150px width of
the cms console window their working in to compare the help text and
screen-captures to the actual tools, without sacrificing any width from the
actual help document ( which in many cases can't really be viewed well at
below 350px width because the screen-captures will cause horizontal
scrolling ). Sure, they could just resize the menu frame all the way over to
the left, but I think having a toggle is a little cleaner and nicer to use.

So ... There's my reasoning. :)

It's all about User X baby! :)

Isaac
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to