From: Nathan Ziarek <nzia...@gmail.com>
Date: Fri, 30 Mar 2012 15:56:10 -0500
Local: Fri, Mar 30 2012 4:56 pm
Subject: Re: How to toggle between prettified text and raw text
Without knowing how you're loading the source, the quickest option might be to just load it twice (or copy the containing element before applying pretty print) <div id="source-original" style="display:none"><SOURCE></div> Then, when you click your button, just toggle between showing and not showing the DIVs. nz On Mar 12, 2012, at 9:16 AM, Ciaran Farrell wrote: > I'm sure that there must be an easy answer to this, but maybe there isn't. I have a <pre id="bar" class="prettyprinter" wrap></pre> into which I dynamically load the contents of a source code file. It seems to work as the contents are displayed with line numbering and styling.
> However, how should I best add a button/link at the top of the page that allows the user to toggle between prettified and raw versions of the content? Someting like a href with id (e.g. foo) doesn't work: > $('#foo').live('click',function(){ > -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||