Dynamically update your Snippets

Submitted by:Pitter Alderson

Date added:19 August, 2013

Category:jQuery

How to dynamically update your Snippets

Tags: dynamically update

Code Snippet:

$(document).ready(function(){
$("pre#dynamic").snippet("php",{style:"navy",clipboard:"js/ZeroClipboard.swf",showNum:false});
// Highlights a snippet of PHP code with the "navy" style
// Hides line numbers
$("pre#dynamic").click(function(){
$(this).snippet({style:"vampire",transparent:true,showNum:true});
// Changes existing snippet's style to "vampire"
// Changes the background to transparent
// Shows line numbers
});
});
 
 

Comments