Using JQuery on blogspot
As I use JQuery these days, I just though how I can use JQuery on my blog.
I tried to do this and found It’s very easy to use it with blogger. Just a few steps
make this possible. You might be wondering where you can place the JQuery file in
blogger. Google has host these file on the following path “http://ajax.googleapis.com/ajax/libs/jquery/”. Just have to select the version you prefer to use.
Just see the following steps.
Step 1:
Add the following code between header tags of your blog’s HTML.
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js' type='text/javascript'/>
</head>
Step 2:
Add the functions in between header tags as follows,
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js' type='text/javascript'/>
<script type="text/javascript">
function MouseOn() {
$(document).ready(function() {
$("img").toggleClass("newClass");
//$("#testPara").append("Shiran the greatest" + count );
});
}
</script>
</head>
Step 3: (Optional)
If there are any CSS involved embed them also in between header tags as follows
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js' type='text/javascript'/>
<script type="text/javascript">
function ChangeCSS() {
$(document).ready(function() {
//here this will toggle CSS classes on an event
$("img").toggleClass("newClass");
});
}
<style type="text/css">
.toggler {width: 100px; height: 200px;}
.newClass {width: 500px; height: 866px;}
</style>
</script>
</head>
Need to call the above ChangeCSS() JS function where this need to be done.
Example:
this maight be in post or a HTML/JavaScript gadget
<img class="toggler" src="http://1.bp.blogspot.com/_8fX3E/S-L0RblzI/AAAADtQ/nB8kJYc/s200/108_f0.jpg" onmouseover="ChangeCSS()"/>
Give your visitors a shock.
Blog Archive
Important Blogs
-
-
-
Loosing can become a painful habit6 months ago
-
Window Close Event of Browser7 months ago
-
-
-
Watch Live Cricket Online Free1 year ago
1 comments:
Thanks for your information n__n
Post a Comment