Is there any reason not to simply use a _javascript_ snipit in a script tag? There are good reasons to put code at the start of a page or in a separate file, but in this case I would say that putting it at the top of the relevant tag is perfectly reasonable:
<ul id="list_xyz"><script>$("#list_xyz").attr(" accordion:settings","accordion:true,showSpeed:'slow',hideSpeed:'fast' ")</script>
</ul>
This implementation can probably be improved, but the concept seems fine.

Blair

On 10/31/06, Ⓙⓐⓚⓔ < [EMAIL PROTECTED]> wrote:
if you really have to validate, and don't want each spec stuffed into
the _javascript_ (script tag or onclick), consider putting the spec
inside a <code class="accordion_snippet"> tag (which would be hidden
in css)
and could be extracted as easily as the title attribute!
or a special dtd defined attribute.

and it is code, so I see no problem with it! Anybody see any problem with that??


On 10/30/06, Kurt Mackey <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Oh yes, and if you really really want to, you could create a custom DTD with
> your special attribute in it.
>
>
>
>
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
> Behalf Of Paul McLanahan
>  Sent: Monday, October 30, 2006 9:38 PM
>  To: jQuery Discussion.
>  Subject: [jQuery] Plugin method question
>
>
>
>
> Hi jQuerians,
>
>  I'm a web developer with an internet banking provider. I've been preaching
> the joys of jQuery to them and they're sold.  We have lots of people who
> maintain the sites we host who aren't the most.... we'll say... skilled when
> it comes to _javascript_.  So, a good deal of my job is to make their job
> easier. Enter jQuery (obviously).
>
>  So I've written my own accordion menus plugin for use at the office which
> uses a definition list.  The reason I wrote yet another one is that I have
> some very specific requirements from our designers as far as features and
> config options.  Unfortunately, I wrote it at work, and since they were
> paying for my time, I'm not sure if I can release the code.  I'm talking to
> them now about allowing me to contribute it to the community and I don't
> have any indication that it won't happen, but I don't feel that I should
> release the code until I get the all-clear from legal.  So I apologize for
> that, but I'll be sure to let you guys know as soon as I'm allowed to
> release it, and I'll put together some docs and a demo page.
>
>  My question though concerns my need to have multiple instances of the
> accordion menu on the same page, but with different options.  I've
> implemented the standard plugin architecture complete with the ability to
> pass in an options object to the plugin function call which overrides the
> defaults via $.extend(). However, my problem is that I want it to keep the
> users of the plugin completely out of the JS. So I have it looking for a
> specific class on a DL and working it's magic from there.  So I'm just using
> the options object passin for more advanced use as a way of overriding the
> defaults for all menus on the page.  So far my method for configuring the
> individual options is a bit controversial. I'm using the title attribute on
> the dl tag to hold a config string that looks something like the following.
>
>  title="accordion:true,showSpeed:'slow',hideSpeed:'fast'"
>
>  I then put curly brackets around the string and eval the whole thing and
> extend the defaults inside the each function and use removeAttrib() to
> remove the ugly title.  This works great and is very unobtrusive and much
> easier to grasp for the JS impaired.  So all's well except for
> accessibility.  If I use the title attrib like I am, then the default UI
> things that happen with title and screen readers will have problems if the
> JS doesn't run.  But if I make up an attrib to house my config, then the
> markup won't validate.  What I'm trying so longwindedly to ask is whether
> the community thinks either of these is the better way to go, or if they
> have a better solution to the problem.
>
>  Thanks in advance for any suggestions/insight.  And especially thanks for
> jQuery and the wonderful array of plugins already available.
>
>  Paul
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
>


--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to