Saturday 18 August 2012

HOW TO highlight syntax in blogger,websites

// siddhu vydyabhushana // Leave a Comment
hello guys i know ,iknow,i know uuuuuu alllll areeeeeee waiting for this one along time , but am here with simple manner so dont worry u can also write

just copy the below soursce code and save it with extension .html       and see the result

if u want to write any code within <pre> and enclosed by </pre>

and u need to replace < with &lt; (including semicolon)
and u need to replace > with &gt; (including semicolon) 


thats all where u have <.> symobls u need to replace

although if have any doubts comment i will clarify

<style>
.srcFmt {
position: relative;
width: 650px;
height: 300px;
overflow: auto;
background-color: #e8e6e2;

margin: 1em 0;
padding: 10px 10px;
}
</style>
<div class="srcFmt" style="width: 430px; height: 500px">
<pre>
<script type="text/javascript">
function moveDomObj(id, l, t)
{
var domObj = document.getElementById(id);

domObj.style.left = l+"px";
domObj.style.top = t+"px";
}

var timer2 = null;
var n2 = 0;

function stepBall2()
{
x = 50+4*n2;
y = 30+1.6*n2*n2; // a parabolic path y=x*x
moveDomObj("ball2", x, y);
n2++;
if (n2>13)
{
clearInterval(timer2);
n2 = 0;
}
}

function startBall2()
{
timer2 = setInterval(stepBall2, 100);
}
</script>
</pre>
</div>

0 comments:

Post a Comment