Two steps for implement jQuery on blogspot post
- Reference jQuery library in your blogspot post
- jQuery code and style code should be in one line
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>
Another option is to upload jquery library file somewhere on the web (look here for advices about uploading files for blogspot) and reference it on blogspot (on blogspot you can upload only images).
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>
This jQuery code (above) should look like this to work on blogspot:
<script type="text/javascript">$(function(){$("#butToggle").click(function(){$('#dvt').toggle(1000);});});</script>
Example of style code (in this form it will not function on blogger):
<style type="text/css">
#dvt
{
width: 200px;
height: 100px;
border: solid 1px black;
background-color:LightGrey;
text-align:center;
display:none;
}
</style>
Style code should be like this to work on blogspot:
This demo show jQuery that works on blogger.When you click toggle button div is shown or hidden.
This works on blogger
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>
Related articles:
Add javascript in blogspot (blogger) post
jQuery hello world
jQuery selectors samples
18 comments:
nice work!
Maybe expand on this, show how to implement, say, a basic 'dropdown/reveal' jquery script within a blog post?
Thanks for the help so far :)
I am not understand you.
Do you think that when click element in dropdown list to hide or show some other HTML element in jQuery?
Hey Buddddddy....
i have a Question
Plzzz answer
Suppose i want to apply such type of javascript in my blogger Posts
http://davidwalsh.name/clipboard
what should i do.......Its not workinf in my posts :( :(
Plzz reply sooon
I take a look at your blog http://davidwalsh.name/clipboard.
To me, your blog look like it is Wordpress, not Blogger.
Unfortunately I have no experience with Wordpress blog, but I believe that it is not too difficult. Maybe you should try to google answer (something like "jquery in wordpress post").
here are other good jQuery tutorials jQuery Duplicate Fields Form Submit with PHP.
It's totally work in my blog :)
Thx U!
Maybe expand on this, show how to implement, a basic 'dropdown/reveal' jquery script within a blog post?
Hi
I have put this code into my blog:
I am trying to make this JQuery work:
http://www.mind-projects.it/projects/jqzoom/
I put the css line into the css box in the advanced section of the design editor. any suggestions on how to get it to work, any help would be much appreciated?
To Richard J. Action.
Try this link: jquery picture zoom
nycccccccccccc + for this :)
allmytutorials.blogpot.com
good query nd vry nice wrk....Hire PHP Programmers
Hello buddy!
I want to make a function, from which anyone can post ad to my blog. can you please tell me the scripting for this????????
To billu barber:
Sorry but I do not know script for this.
I think this can not be done with a just a client script.
jQuery has a strong community that does a good job in verifying and listing modules on the official portal. Let us consider for example that a programmer wishes to use 'Date Picker'(Date Picker element is used to select a date from a pop up calendar. Once selected, the date value will be populated in an adjoining text box.
jquery jobs
Thank you!!!!! I have been looking for the code to toggle content in my blog post and pages. This was simple!
This code is very useful for me. Thanks for this.
Hello
I want to add close button in this Jquery
How can I do this ? Please help me
nice work!
I got new information from your post.
Post a Comment