Spoiler with Jquery on Blogspot
You find some cool jQuery features but don't know how to include jQuery code into your blogspot blog? Here you will find two steps needed to jQuery work on your blog.
Two steps for implement jQuery on blogspot post
And here is code needed for this demo that should be in blogspot post:
Demo : click toggle below
Two steps for implement jQuery on blogspot post
- Reference jQuery library in your blogspot post To provide jQuery work you must reference jQuery library. One option is to reference on jquery-1.3.2.min.js file on google code.
- <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>
- jQuery code and style code should be in one line Example of jQuery code (in this form it will not function on blogger):
- <script type="text/javascript">
- $(function()
- {
- $("#butToggle").click(function()
- {
- $('#dvt').toggle(1000);
- });
- });
- </script>
- <script type="text/javascript">$(function(){$("#butToggle").click(function(){$('#dvt').toggle(1000);});});</script>
- <style type="text/css">
- #dvt
- {
- width: 200px;
- height: 100px;
- border: solid 1px black;
- background-color:LightGrey;
- text-align:center;
- display:none; }
</style> - <style type="text/css">#dvt{width: 200px;height: 100px;border: solid 1px black;background-color:LightGrey;text-align:center; display:none;}</style>
And here is code needed for this demo that should be in blogspot post:
- <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script type="text/javascript">$(function(){$("#butToggle").click(function(){$('#dvt').toggle(1000);});});</script>
- <style type="text/css">#dvt{width: 200px;height: 100px;border: solid 1px black;background-color:LightGrey;text-align:center; display:none;}</style>
- <div id="dvt">This works on blogger</div>
- <button id="butToggle">Toggle</button>
This works on blogger