Tuesday, March 16, 2010
Friday, March 12, 2010
Draw a yellow line under the 8th list item.
- Boston Bruins
- Washington Capitals
- New Jersey Devils
- Pittsburgh Penguins
- Philadelphia Flyers
- Carolina Hurricanes
- New York Rangers
- Montreal Canadians
- Florida Panthers
- Buffalo Sabres
- Ottawa Senators
- Toronto Maple Leafs
- Atlanta Thrashers
- Tampa Bay Lightning
- New York Islanders
Wednesday, March 10, 2010
How to copy a portion of DOM in jQuery
Following code will create a list before ".post-body" class and copy it and appends it after the class.
Tuesday, March 9, 2010
The easiest way to insert javascript, html code to SyntaxHighlighter
Button created right below this
The easiest way to use SyntaxHighlighter, that I found, is insert your code in the
<pre> tag without any html encoding, then run following javascirpt. '.js' is a class name of the pre tag. If you have multiple pre tags, then add id in the pre tag and apply following script with id selector instead of class selector. (Of course, do not include new line(s) in your code if you are using blogger site.)
Fade In and fade out
This is fade in and out sample.
<script type="text/javascript">
$('<button id="btnFadeOut">Fade Out</button>id="btnFadeIn" style="margin-left:10px;">In</button>p id="pFadeInOut">paragraph can fade in and out</p>')
.filter('#btnFadeOut')
.click(function(){$
('#pFadeInOut').fadeOut(3000);
})
.end()
.filter('#btnFadeIn')
.click(function(){
$('#pFadeInOut').fadeIn(3000);
})
.end()
.insertAfter('.fadeInOutContext');
</script>
Creating Slide up/down button
<script type="text/javascript">
$('<button class="btnSlide">Slide up/down</button><div style="width:300px;height:50; border: solid 1px black; background-color:Yellow;text-align:center;" class="divSlide">This toggle can be slide up and down</div>')
.filter('.btnSlide')
.click(function(){$('.divSlide').slideToggle("slow");})
.end()
.insertAfter('.post-title');
</script>
Subscribe to:
Comments (Atom)