Very quick and dirty but you can see that it can be done in not alot of code 
at all .... to be honest i think i can get rid of about another 5 lines at 
least

http://www.bazookawally.co.uk/collapse.php

HTH

Alex
----- Original Message ----- 
From: "TEC" <traceyedwardscomp...@gmail.com>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Tuesday, June 23, 2009 4:11 PM
Subject: [Proto-Scripty] Re: Two sets of expand and contract icons?



Thanks again for the reply.

Here is a working example of the script I used: 
http://www.ryanscherf.net/demos/dtd/
and the tutorial that goes along with it:
http://www.ryanscherf.net/blog/dynamic-effects-via-the-dtd-part-2

It looks like it is an add on to scriptaculous.  Took me a few minutes
to find that tutorial I found 2 months ago when I started working on
website i will be using it for.  That project went on hold and now I'm
starting up on it again and this is one of the last remaining pieces
on it.

I don't really wont to trouble you with writing the bones, but if it's
something that you can do real quick and I can get a learning
experience out of it by all means go ahead,  But please don't trouble
your self with it=)


Thanks again

~Chris

On Jun 23, 10:42 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:
> i dont know what decorators.js is so i cant help you with that, though it
> woudlnt take long to script something to do this toggleing...
>
> It would be standards complient too as adding nodes to elements
> (collapsable="true" etc etc) is not complient and would fail W3c
> validation...
>
> I would tackle it with classnames and an array of elements to start as 
> flat
>
> I could write the bones for you to get you started if you like then you cn
> learn a bit aswell !!
>
> Let me know
>
> HTH
>
> ALex
>
> ----- Original Message -----
> From: "TEC" <traceyedwardscomp...@gmail.com>
> To: "Prototype & script.aculo.us" 
> <prototype-scriptaculous@googlegroups.com>
> Sent: Tuesday, June 23, 2009 3:10 PM
> Subject: [Proto-Scripty] Re: Two sets of expand and contract icons?
>
> Thanks for the reply.
>
> I thoguht I was already using scriptaculous, but I could be wrong.
>
> The div structure is as following:
>
> <div id="locations_results" class="location" collapsible="true"
> collapse="true">
> <h5>header</h5>
> <div id="services_info_container">
>
> <!-- Content inside Div -->
>
> </div>
> <!-- end locations info container -->
> </div>
>
> and the page includes:
>
> </script>
> <script src="scripts/decorators.js" type="text/javascript"></script>
> <script src="scripts/prototype.js" type="text/javascript"></script>
> <script src="scripts/effects.js" type="text/javascript"></script>
> <script src="scripts/scriptaculous.js?load=effects" type="text/
> javascript"></script>
>
> The collapse='true' comes from a modification I made to decorators.js
> from a tutorial that shows how to start a div in the collapsed state.
> There are also a few style sheet entries that tell the icons where to
> appear.
>
> Is there an easier way of creating collapsible divs with two sets of
> icons and some divs starting in the collapsed state then I am
> currently using?
>
> Thanks
>
> On Jun 23, 9:57 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
> wrote:
> > you can do this easily with proto/scriptaculous or vanilla javascript, i
> > would recommend staying away from pre-made scripts for this easy task as
> > it
> > will inhibit what you can do and what you learn from writing
> > applications....
>
> > Alex
>
> > ----- Original Message -----
> > From: "TEC" <traceyedwardscomp...@gmail.com>
> > To: "Prototype & script.aculo.us"
> > <prototype-scriptaculous@googlegroups.com>
> > Sent: Tuesday, June 23, 2009 2:47 PM
> > Subject: [Proto-Scripty] Two sets of expand and contract icons?
>
> > > I'm working on a website where there are two styles of divs that need
> > > to expand and collapse. I have made custom icons for expand and
> > > contract for each set of divs.
>
> > > But from looking at the script, it appears you can only use one set of
> > > icons. Is there away edit decorators.js so two sets of icons can be
> > > used?
>
> > > I have started to play around and modify the file my self but I keep
> > > breaking the expand and contract and can't seem to get it to work
> > > right and was hoping someone here could point me in the right
> > > direction. The vars for the icons are as following.
>
> > > var expImg = "images/expand.jpg";
> > > var conImg = "images/contract.jpg";
> > > var expImg2 = "images/location_down.jpg";
> > > var conImg2 = "images/location_up.jpg";
>
> > > Thank you



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to