On 07/03/2007, at 1:52 AM, Denis wrote:
> Can you please share working context menu example?
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

Hi Denis,

I am thinking you may be meaning my Page Contents Menu plugin (rather  
than 'context'). Here are two working examples where I have used it  
on clients' sites:

The first example uses it to make a long news page easier to navigate  
whilst also providing an overview of the separate news stories at the  
top of the page. I have combined the plugin with an animated scroll  
effect (when you click a link) which complements it nicely as it  
shows the user where on the page they are being taken. The scroll  
effect comes from Interface.
http://www.preshil.vic.edu.au/news/diary/
The plugin is used on a few other pages of that site also. This  
example highlights a strength of the idea in that if a page is  
regularly updated (as the Preshil news page is), the list is  
automatically updated to reflect the new content it is built from, so  
the list never needs to be manually maintained. Here is the code I  
use to invoke the plugin on the news page:

$("body.diar, body.fees, body.pol")/*targets pages that I want to  
apply a menu to*/
        .find("#main h2")       /*targets the page elements I want the list  
created from*/
        .contentMenu({ /*invokes plugin passing in options object to  
override some defaults*/
                "aClass":"scrolls",
                "divClass":"alert"
        });

The second example shows the plugin used on an FAQ page to summarise  
the questions and provide links to the relevant answers. No added  
scroll effect here, but it could benefit from it as I think the  
sudden jump after clicking a link is disorienting.
http://www.blushtomatoes.com.au/consumer-info/faqs/
Here is the code I use to invoke the plugin on the FAQ page:

$("body.faq"). /*targets pages that I want to apply a menu to*/
        find("#main dt"). /*this time the list is created from dt elements*/
        contentMenu({
                "head":"", /*no separate heading needed for this list*/
                "insertTarget":$("#main dl.module:eq(0)") /*custom target to 
insert  
menu before*/
        });

My apologies for not providing a decent demo page yet - I plan to  
when I get a break in my work schedule.

Hope this helps. Please let me know if you have any suggestions or  
questions. Oh, and if you actually did mean 'context menu', just  
ignore all of this ;)

Joel Birch.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to