Monday, September 15, 2014
Thursday, September 11, 2014
Export HTML table values into PDF using jsPDF
Tuesday, September 9, 2014
Export HTML table values into Excel using jQuery
Today i am going to explain how to export the html table data into excel using jQuery.
Live Demo
Download Script
We need jquery libraya nad plugin files to perform this action.Please copy and Paste below library file.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="jquery.btechco.excelexport.js"></script>
<script src="jquery.base64.js"></script>
We need jquery libraya nad plugin files to perform this action.Please copy and Paste below library file.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="jquery.btechco.excelexport.js"></script>
<script src="jquery.base64.js"></script>
Jquery function
<script>
$(document).ready(function () {
$("#btn").click(function () { //button Id
$("#Exporttbl").excelexport({ //table id
containerid: "Exporttbl"
, datatype: $datatype.Table
});
});
});
</script>
$(document).ready(function () {
$("#btn").click(function () { //button Id
$("#Exporttbl").excelexport({ //table id
containerid: "Exporttbl"
, datatype: $datatype.Table
});
});
});
</script>
HTML
<table id="Exporttbl" border="1" style="border-collapse: collapse;">
<thead>
<tr>
<th>Sno</th>
<th>Programming Languages</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Java</td>
</tr>
</tbody>
</table>
Please share your comments and feedback.Thanks.Please subscribe my updates via email.<thead>
<tr>
<th>Sno</th>
<th>Programming Languages</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Java</td>
</tr>
</tbody>
</table>
Sunday, September 7, 2014
Snow Effect using jQuery
This is very useful script for web developers.In this i have used many methods like html(),Math.random(),remove(),appendTo(),css(),clone() etc.
Live Demo
Download Script
Please copy and Paste below library file.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
to display snow effect to call the following HTML code with ID.
Please copy and Paste below library file.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
Snow plugin
<script>
(function($){
$.fn.snow=function(options){
var $flake=$('#snow').css({'position':'absolute','top':'-50px'}).html('❄'),//Get element values using ID
documentHeight=$(document).height(),
documentWidth=$(document).width(),
defaults={minSize:2,maxSize:8,newOn:200,flakeColor:"#fff"}, //Snow size and color
options=$.extend({},defaults,options);
var interval=setInterval(function(){
var startPositionLeft=Math.random()*documentWidth-100,
startOpacity=0.5+Math.random(),
sizeFlake=options.minSize+Math.random()*options.maxSize,endPositionTop=documentHeight-40,
endPositionLeft=startPositionLeft-100+Math.random()*400,durationFall=documentHeight*10+Math.random()*6000;
$flake.clone().appendTo('body').css({left:startPositionLeft,opacity:startOpacity,'font-size':sizeFlake,color:options.flakeColor}).animate({top:endPositionTop,left:endPositionLeft,opacity:0.2},durationFall,'linear',function(){$(this).remove()});},options.newOn);
};
})(jQuery);
</script>
(function($){
$.fn.snow=function(options){
var $flake=$('#snow').css({'position':'absolute','top':'-50px'}).html('❄'),//Get element values using ID
documentHeight=$(document).height(),
documentWidth=$(document).width(),
defaults={minSize:2,maxSize:8,newOn:200,flakeColor:"#fff"}, //Snow size and color
options=$.extend({},defaults,options);
var interval=setInterval(function(){
var startPositionLeft=Math.random()*documentWidth-100,
startOpacity=0.5+Math.random(),
sizeFlake=options.minSize+Math.random()*options.maxSize,endPositionTop=documentHeight-40,
endPositionLeft=startPositionLeft-100+Math.random()*400,durationFall=documentHeight*10+Math.random()*6000;
$flake.clone().appendTo('body').css({left:startPositionLeft,opacity:startOpacity,'font-size':sizeFlake,color:options.flakeColor}).animate({top:endPositionTop,left:endPositionLeft,opacity:0.2},durationFall,'linear',function(){$(this).remove()});},options.newOn);
};
})(jQuery);
</script>
Jquery function
<script>
$(document).ready( function(){
$.fn.snow();
});
</script>
$(document).ready( function(){
$.fn.snow();
});
</script>
HTML
<div id="snow"></div>
Please share your comments and feedback.Thanks.Please subscribe my updates via email.Friday, September 5, 2014
Some useful CSS and Javascript tips
Some useful CSS and Javascript tips
Use the following Css code for hide anchor link.
Using onmouseover and onmouseout, We can hide and show div content.Find the below code for example or click live demo button.
Please share your comments and feedback.Thanks.Please subscribe my updates via email.
Use the following Css code for hide anchor link.
Hide tag link using CSS
<a href="http://www.google.com" class="first">Google</a>
<style>.first{ pointer-events:none;}</style>
<style>.first{ pointer-events:none;}</style>
Show hide div using Javascript
<a onmouseover="document.getElementById('div_name').style.display='block';" onmouseout="document.getElementById('div_name').style.display='none';"
href="" onclick="return false;">
Show</a>
<br />
<div id="div_name" style="display:none;margin:15px 15px 0px 15px;padding:5px;border:1px solid #aaa;">
This is more information placed in our hidden div.
When you move your mouse off the link above this DIV area will
disappear.
</div>
href="" onclick="return false;">
Show</a>
<br />
<div id="div_name" style="display:none;margin:15px 15px 0px 15px;padding:5px;border:1px solid #aaa;">
This is more information placed in our hidden div.
When you move your mouse off the link above this DIV area will
disappear.
</div>
Show hide div using CSS
<style type="text/css">
.popup {position: fixed;visibility: hidden;border:1px solid #000; padding:5px;}
a:hover + .popup {visibility: visible;}
</style>
<a href="#">Show Popup</a>
<p class="popup">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
.popup {position: fixed;visibility: hidden;border:1px solid #000; padding:5px;}
a:hover + .popup {visibility: visible;}
</style>
<a href="#">Show Popup</a>
<p class="popup">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
CSS3 Text Effects
CSS3 Text Effects
Please share your comments and feedback.Thanks.Please subscribe my updates via email.
Shadow
<style>#txt{text-shadow: 0 6px 4px #85c226,-3px -5px 4px #fe2192, 3px -5px 4px #f7c200; }</style>
Double
<style>#txt{text-shadow:0px -10px 0 #fe2192;font-size:30px;}</style>
Blur
<style>#txt{color: transparent;text-shadow: 0 0 5px rgba(0,0,0,0.5);}</style>
Cloudy Text Effect
<style>#txt{text-shadow: 0px 0px 10px rgba(255,255,255,0.6), 0px 0px 30px rgba(255,255,255,0.4), 0px 0px 50px rgba(255,255,255,0.3), 0px 0px 180px rgba(255,255,255,0.3);color: rgba(255,255,255,0);font-size: 30px;background:#000;}</style>
Embossed Text Effect
<style>#txt{text-shadow: -1px -1px 1px #fff, 1px 1px 1px #000;color: #9c8468;opacity: 0.3;}</style>
City Lights Text Effect
<style>
#txt{color: #fff;text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff2d95, 0 0 30px #ff2d95, 0 0 40px #ff2d95, 0 0 50px #ff2d95, 0 0 75px #ff2d95;letter-spacing: 5px;}</style>
#txt{color: #fff;text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff2d95, 0 0 30px #ff2d95, 0 0 40px #ff2d95, 0 0 50px #ff2d95, 0 0 75px #ff2d95;letter-spacing: 5px;}</style>
Tuesday, September 2, 2014
Change background color on Hover and onClick using Javascript
This is an example of how to change the background color using the OnClick and Hover using javascript.
Please share your comments and feedback.Thanks.Please subscribe my updates via email.
Javascript Function
<script language="JavaScript">
function changebg(color){
document.bgColor = color;
}
</script>
function changebg(color){
document.bgColor = color;
}
</script>
Mouseover Change Bg Color
<p><a href="#" onMouseOver="javascript:changebg('#EB2525')">Mouseover <strong>Red</strong></a></p>
MouseClick Change Bg Color
<p><a href="#" onclick="javascript:changebg('#000099')">MouseClick <strong>Blue</strong></a></p>
Subscribe to:
Posts (Atom)





